---
schema_version: "1"
id: 02472e7550bfd5407277aee5cc2cd0f57805850aba2bfed0474c524d44f34b54
title: Create a Query Using SQL
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/dato_data_lakes_query_create.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.dato_data_lakes_query_create.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 1320683b46c6edd1e33cc1c142fea656c294392dbc9761c07135da2f7180e87a
description: You can use SQL to create joins between tables sourced from different data streams, perform calculations, and apply filters.
products:
  - Marketing
  - Marketing Cloud Intelligence
release: "264"
---
# Create a Query Using SQL

You can use SQL to create joins between tables sourced from different data streams, perform calculations, and apply filters.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d25052e38">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d25052e38 ">To create a Granular Data Center query:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d25052e38 ">Admin</td>

          </tr>
        </tbody>
      </table>

Marketing Cloud Intelligence supports Presto SQL. For more information, see [Presto documentation](https://prestodb.io/docs/current/functions.html).

1. From the **Connect & Mix** tab, select **Granular Data Center**, and then **Query Granular Data**.
2. Click **Create New Query**. SQL is selected by default.
    
    ![create\_new\_query](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-salesforce_datorama-264-0-0-production-enus/d38a342d-dd4a-4af8-8343-f372280a75dd/salesforce_datorama/images/datalakes/data_lake_query_new.png)
3. Click **Create**.
4. Create a query.
    
    ![query\_sql](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-salesforce_datorama-264-0-0-production-enus/d38a342d-dd4a-4af8-8343-f372280a75dd/salesforce_datorama/images/datalakes/data_lakes_new_sql.png)
5. To see the results, click **Run** (1). The results appear in the **Preview** area at the bottom of the page (2).
6. To automatically format the query so that all commands are aligned, click **Auto format query** (3).
7. To reuse a query, click **Copy to Clipboard** and then paste in the relevant location (4).
8. To add the query to the Query Library for future use, click **Save**.
9. To upload the query to Marketing Cloud Intelligence as another data source, click **Materialize Query** (5).
    
    During the initial query process of creating the data stream or data lake, only the first 1000 rows are processed. After that the entire dataset is retrieved.
    
    To learn more, see [Save Query Results as a Data Source](https://help.salesforce.com/s/articleView?id=mktg.dato_data_lakes_query_save.htm&release=264.0.0&type=5 "You can upload query results to Marketing Cloud Intelligence as a new data source that complements existing data not related to the Granular Data Center.").
10. To export the query results, click **Schedule Export** (6). To learn more, see [Export Query Results](https://help.salesforce.com/s/articleView?id=mktg.dato_data_lakes_query_export.htm&release=264.0.0&type=5 "You can download or export query results to S3, SFTP, Google Cloud Platform, Azure Blob, or email and define an ongoing schedule.").