0
0
Snowflakecloud~10 mins

Clustering keys for large tables in Snowflake - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a clustering key on the 'customer_id' column.

Snowflake
ALTER TABLE sales_data CLUSTER BY ([1]);
Drag options to blanks, or click blank then click option'
Acustomer_id
Bproduct_id
Cregion
Dorder_date
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a column that is rarely used in queries.
Using a column with low cardinality as clustering key.
2fill in blank
medium

Complete the code to create a clustering key on multiple columns: 'region' and 'order_date'.

Snowflake
ALTER TABLE sales_data CLUSTER BY ([1], order_date);
Drag options to blanks, or click blank then click option'
Aproduct_id
Bcustomer_id
Cregion
Dsales_amount
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of clustering columns.
Using columns not suitable for clustering.
3fill in blank
hard

Fix the error in the clustering key syntax to cluster by 'order_date'.

Snowflake
ALTER TABLE sales_data CLUSTER BY [1];
Drag options to blanks, or click blank then click option'
A(order_date)
B'order_date'
Corder_date
D[order_date]
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around column names.
Using brackets instead of parentheses.
4fill in blank
hard

Fill both blanks to create a clustering key on 'region' and 'customer_id'.

Snowflake
ALTER TABLE sales_data CLUSTER BY ([1], [2]);
Drag options to blanks, or click blank then click option'
Aregion
Border_date
Ccustomer_id
Dproduct_id
Attempts:
3 left
💡 Hint
Common Mistakes
Reversing the order of clustering columns.
Using columns not relevant for query patterns.
5fill in blank
hard

Fill all three blanks to create a clustering key on 'region', 'order_date', and 'product_id'.

Snowflake
ALTER TABLE sales_data CLUSTER BY ([1], [2], [3]);
Drag options to blanks, or click blank then click option'
Aregion
Border_date
Cproduct_id
Dcustomer_id
Attempts:
3 left
💡 Hint
Common Mistakes
Incorrect order of clustering columns.
Including columns that are not useful for clustering.