Run your first SQL query on a public dataset using the MaxCompute console and download the query results to your local machine — no data upload required.
Prerequisites
Before you begin, ensure that you have:
-
A MaxCompute project. Create a MaxCompute project if you don't have one yet.
-
Project access. An Alibaba Cloud account provides access immediately — no additional authorization needed. If you're a Resource Access Management (RAM) user without project permissions, ask your MaxCompute project administrator to grant permissions.
Billing
This guide uses a public dataset provided by MaxCompute for testing purposes. Data accuracy is not guaranteed, and the dataset is not updated regularly. Do not use it in production.
Running all queries in a sample file once costs approximately CNY 10. Usage within the free quota is not charged. Excess usage is billed on a pay-as-you-go basis.
Run your first query
-
Log on to the MaxCompute console and select a region in the top-left corner.MaxCompute console
-
In the left navigation pane, choose Data Exploration > SQL Analysis.
-
Click the EXPLORER icon
and select a sample file from COMMONDATASET DEMO. -
Click Run Configurations on the right and set the following:
Parameter Required Description Project Yes The project in which to run the SQL statement Computing Quota No Use the project's default computing quota, or specify a different execution quota -
Click Run and wait for the query to complete. After the query finishes, click the
icon in the results area to explore a simple visual analysis of the data.
The SQL Analysis page has two versions — classic and new. The steps above apply to both. In the new version, the EXPLORER iconappears in the left navigation pane, and the Computing Quota field is labeled Quota.
Procedure
If you created a MaxCompute project using DataWorks, you can use the Data Analysis submodule of DataWorks to quickly explore the query capabilities of MaxCompute.
This example uses the TPC-DS performance test data from the public datasets to demonstrate how to run a standard test SQL statement and download the query results to your local machine.
-
Log on to the MaxCompute console and select a region in the upper-left corner.
-
In the navigation pane, click DataWorks > Data Analysis to open the Data Analysis submodule of DataWorks. Then, click the
icon on the left to open the SQL query page. -
In the pane on the left, hover over My Files, click the
icon to its right, and then select New File. Follow the on-screen instructions to create an SQL query file. -
In the upper-right corner of the page, select your Workspace and Data Source Name. Set Data Source Type to MaxCompute.
NoteYou can select only data sources that you are authorized to use. If the data source that you want to use is not displayed, contact an administrator to grant you the required permissions. To run SQL queries, you must also be assigned one of the following roles: Data Analyst, Developer, O&M, or Workspace Administrator.
-
In the code editor, enter the following SQL statement and click the
icon.SET odps.namespace.schema=TRUE; SELECT dt.d_year , item.i_brand_id brand_id , item.i_brand brand , SUM(ss_sales_price) sum_agg FROM bigdata_public_dataset.tpcds_10g.date_dim dt , bigdata_public_dataset.tpcds_10g.store_sales , bigdata_public_dataset.tpcds_10g.item WHERE dt.d_date_sk = store_sales.ss_sold_date_sk AND store_sales.ss_item_sk = item.i_item_sk AND item.i_manufact_id = 190 AND dt.d_moy = 12 GROUP BY dt.d_year , item.i_brand , item.i_brand_id ORDER BY dt.d_year, sum_agg DESC, brand_id LIMIT 100;The following result is returned.

-
In the upper-right corner of the query results, click to open the Workbook page for data analytics.

-
On the Workbook page, click Download to download the query results to your local machine.
The downloaded file is in Excel format.
NoteYou can click Download on the Workbook page if you use DataWorks Standard Edition or a later edition and have the Download permission for the table.
What's next
Now that you've run your first query, explore more of what MaxCompute offers in Next steps.