Saved Queries

View and Manage Saved Queries

View and manage queries written and saved in SQL Lab for future reference and quick access to rerun previously used SQL queries without rewrite.

  1. Click SQL in the toolbar and select SQL Lab from the dropdown list.


     
  2. Search or filter the list by entering the Name or by selecting the Database, Schema, and Modified By.
  3. Search and filter data by the following columns:
    1. Name: The title or identifier of the saved query.
    2. Description: A brief summary or notes about the saved query.
    3. Database: The database associated with the saved query.
    4. Schema: The schema in which the query operates or pulls data from.
    5. Tables: The tables referenced or involved in the saved query.
    6. Last Modified: The date and time when the saved query was last updated.
    7. Actions: Available operations to manage Preview, Edit, Copy, Export, and Delete query.


       
  4. Under the Action column, you can perform the following activities:

    Query Preview to view the query saved.
    Copy Query URL to copy the query URL.
    Delete the saved query.
    Export the saved query into a CSV file.
    Edit to edit the database.
  5. To edit the query in SQL Lab. For more information, refer to Section 3.1.1 SQL Lab.

Add a New Query

  1. Click SQL in the toolbar and select SQL Lab from the dropdown list.


     
  2. Click QUERY to create a new query.


     
  3. Select the Database, Schema, and See Table Schema from the dropdown menu.
    Note: Based on the database, you can view the schema and examine the table structure, which is already integrated with the database.
  4. Add queries in the query section located on the right side of the screen as needed.
  5. Click Run to run the query.


     
  6. Set the query limit if required to control the maximum number of records returned by the query, ensuring better performance and resource management.
  7. Click Save and view the query in the saved query list. For more information, refer to Section 3.2 Saved Query.
  8. Click Copy Link to copy the query link.



    Note: After running the query, you can view the results, query history, and a preview of the executed query.
  9. For refined analysis, click Results, Query History, and Preview tabs.
  10. Click RESULT to view the result of the executed query, including create chart, download to csv, and copy to clipboard.
    1. CREATE CHART: Add a chart based on the executed query results.
    2. DOWNLOAD TO CSV: Download the query results in CSV format.
    3. COPY TO CLIPBOARD: Copy the query results to your clipboard.


       
  11. Click QUERY HISTORY to view the query history, including State, Started, Duration, Progress, Rows, SQL, Results, and Actions.
    1. State: The status of the query.
    2. Started: The timestamp indicating when the query execution began.
    3. Duration: The amount of time taken to execute the query.
    4. Progress: The completion percentage of the processed query.
    5. Rows: The number of rows returned by the query.
    6. SQL: The SQL query that was executed.
    7. Results: A preview of the query’s output or the number of records retrieved by clicking on the icon.
    8. Actions: Available options to interact with the query, such as overwrite text, run query in new tab, or deleting the query.


       
  12. Click PREVIEW to view query results.

Was this article helpful?