Build and run custom SQL query

Build and run a custom SQL query.

Steps

  1. At the top of the Query Editor page, you’ll find a description box. While adding a description is optional, it can serve as a helpful reference to others. A brief description can provide a quick overview of the query’s purpose, the data it retrieves, and any useful tips for running it effectively.

  2. Write your custom SQL query in the Query box.

    Use the Data Cloud Schema on the right-hand side to help create your query. Click on the Schema column names to expand them and view the associated data types. Or, use the search bar to quickly find a data type of interest. Click on the name of the data type to add it to your query editor.

  3. Save your query by clicking the blue ‘Save’ button in the upper right corner. Queries do not auto-save as you go, so it's a good idea to periodically save your progress to ensure you don't lose what you've created.

  4. Click the blue ‘Run’ button at the bottom of the Query box. This will provide a preview of the first 25 records in your results and the estimated total number of results.

  5. A preview of the first 25 records in the results and the estimated total number of results will be displayed in the Results Preview. Because queries are custom and can be created with virtually any data point in the platform, what's included in the results and how they will be displayed will depend on how the query was written.

    For example, the image below are the results from a query looking at campaigns running during a given time period. The results show the campaign ID, number of users, and points awarded for each campaign.

  6. If satisfied with the preview of your results, you can then choose to either save your query and return to it later or export the data.