# Creating or Editing a Query Queries can be created in the TD Console through the query editor in Data Workbench using the Presto or Hive query engines. Learn more about [additional features in the editor.](/products/customer-data-platform/data-workbench/queries/additional-editor-features) This topic contains: ## Locate a query 1. In TD Console, select the Data Workbench icon. ![](/assets/image-20190905-230822.04e3de913ce065f0b7006fd32719de5e2e7473cc93a7ccd0b9f119e07e071a0a.89112c51.png) 1. Select **Queries** to go to the query editor. You can see a list of previous queries and when they were run. This list is useful if you want to edit or rerun a specific query. ![](/assets/image-20190905-230904.a8744053faa77ba10228e951256e20dd2e81881dd49518a305b9546418f76d96.89112c51.png) ## Create or edit a query You can also use the Queries page to create a new query. 1. Select **NEW QUERY** on the top right of the TD Console to open the query editor. ![](/assets/image-20190905-230954.5db3c048a4aab1df4ad357ef146285357b7b6519af312ad1d8ff3f9263376c14.89112c51.png) 1. After you have opened the query editor, you will see that you have two options for querying the data—Presto and Hive, depending on the use case, the size and type of the query, you will choose which query engine to use. [Presto](https://api-docs.treasuredata.com/en/tools/presto/quickstart/#how-presto-works) is better for ad hoc and shorter batch workloads. Presto provides low-latency SQL access to the data set. [Hive](https://api-docs.treasuredata.com/en/tools/hive/quickstart/#about-the-hive-engine) is better for large or complex batch workloads. Hive is a MapReduce-based SQL engine. This engine is really powerful when you do large data processing and heavy JOINs. Often used for ETL or sessionization. 1. Select the appropriate query engine option in the drop-down menu. 2. Select the database you want to query. 3. Select the tables from which you want to query. 4. Specify if you would like to run it on a regularly recurring schedule or just once. 5. Create your specific query using the appropriate SQL syntax for Presto or Hive. You may preview any table under Table Preview. ![](/assets/image-20190905-231033.27613a831cecfc8e5ca0b804a8a664d7c50812598f382f6005be00796a80fa38.89112c51.png) 1. If you need to edit your query, you can view autocomplete suggestions for SQL keywords, types, functions, and Treasure Data-specific functions. Learn more about [additional features in the editor.](/products/customer-data-platform/data-workbench/queries/additional-editor-features) ![](/assets/image2022-4-26_16-1-56.d225e04fb78e82690884045d89d6b66da847f406f8e4d43eb4216d69ec1e1423.89112c51.png) 1. Select **Save** if you want to run it at a later date or select **Run** if you want to run it immediately. ![](/assets/image-20190905-231054.9804de0fc308e544a4f7498b216135e7a669adce2d9c0d66ac655ec962de3b0b.89112c51.png) 1. After the query has run, you see the results under Query Result. You now have the option to Copy or Download the results. ![](/assets/image-20190905-231119.d6d38ad9222d81c19809a47728a94cfe00711784419a7ae903eb298e95c2dfeb.89112c51.png)