Skip to main content

Creating and Executing a Query

Steps to Writing a New Query

Access the Query Editor

  • Log in to your Analyzee account and navigate to the Dashboard service using the sidebar.
  • Click on the "Queries" tab to access the Query Editor, where you can write and execute SQL queries.
  • Click on the "New Query" button to create a new query or select an existing query to edit.
  • Use the search bar to find specific queries.

Query Editor

The Query Editor allows you to write and execute SQL queries to retrieve data from various data sources.

Select the Data Source

  • Before writing your query, choose the appropriate data source from which you want to retrieve data.
  • This could be an internal database, an external API, or another data repository.
  • The basic data source provided by Analyzee is the official Analyzee data source and is a good starting point for most queries.

Data Source

Select the data source from which you want to retrieve data.

Write the SQL Query

  • Using the SQL (Structured Query Language) syntax, write your query to retrieve the desired data. This may involve selecting fields, filtering rows, joining tables, or performing other operations based on your objective.
  • Go to the Query Editor and enter your SQL query in the text box provided. Use the query builder tools to assist in constructing the query if needed.
  • For more detailed instructions on how to write SQL queries, refer to the SQL documentation or visit the Analyzee SQL Guide.

Test Your Query

  • Before executing the query, it's essential to test it to ensure it returns the expected results. Use sample data or a limited dataset to validate the correctness of your query.

Refine and Optimize

  • Review your query for any inefficiencies or areas for improvement. Consider optimizing the query for performance by minimizing complexity, using appropriate indexing, and leveraging database-specific features.

Execute the Query

  • Once you're confident in your query's accuracy and efficiency, execute it against the chosen data source. This will retrieve the data based on the criteria specified in your query.
  • Click on the "Execute" button to execute the query and view the results in the output window.

Execute Query

Review Results

  • Examine the results returned by the query to verify that they align with your expectations. Pay attention to data integrity, completeness, and relevance to ensure the query meets your requirements.

Iterate as Needed

  • Depending on the outcome of your query and any feedback received, be prepared to iterate on the query as necessary. This may involve refining the logic, adjusting parameters, or incorporating additional conditions.

Save your Query

  • Click on the "Save" button to store your query for future use. Provide a descriptive name to help identify the query later on.

Document Your Query

  • Document your query with comments or annotations to provide context and clarity for future users. Include information such as the purpose of the query, its inputs and outputs, and any assumptions made during the query-writing process.