0
0
Snowflakecloud~10 mins

Result caching layers 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 enable result caching for a query in Snowflake.

Snowflake
SELECT * FROM sales WHERE region = 'US' [1];
Drag options to blanks, or click blank then click option'
A/*+ RESULT_CACHE */
BUSE RESULT_CACHE
CENABLE RESULT_CACHE
DRESULT_CACHE = TRUE
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to use SQL keywords like ENABLE or USE which are not valid for result caching hints.
Adding options outside of comment syntax.
2fill in blank
medium

Complete the code to check if result caching is enabled for a query in Snowflake.

Snowflake
SELECT query_id, result_caching FROM table(information_schema.query_history()) WHERE query_text LIKE '%[1]%';
Drag options to blanks, or click blank then click option'
ARESULT_CACHING
BSELECT
CRESULT_CACHE
DCACHE
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect keywords that do not appear in query_text.
Confusing column names with SQL keywords.
3fill in blank
hard

Fix the error in the query to disable result caching for a specific query.

Snowflake
SELECT * FROM orders [1] RESULT_CACHE = FALSE;
Drag options to blanks, or click blank then click option'
A/*+ RESULT_CACHE = FALSE */
BNO RESULT_CACHE
CDISABLE RESULT_CACHE
DSET RESULT_CACHE = FALSE
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to use SET or NO keywords which are invalid in this context.
Placing the hint outside of comment syntax.
4fill in blank
hard

Fill both blanks to create a query that uses result caching and filters by region 'EU'.

Snowflake
SELECT * FROM sales [1] WHERE region [2] 'EU';
Drag options to blanks, or click blank then click option'
A/*+ RESULT_CACHE */
B=
C!=
D/*+ NO_RESULT_CACHE */
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong comment hint to disable caching.
Using '!=' instead of '=' for filtering the region.
5fill in blank
hard

Fill all three blanks to create a query that disables result caching, filters orders with amount greater than 100, and orders results by date.

Snowflake
SELECT * FROM orders [1] WHERE amount [2] 100 ORDER BY [3];
Drag options to blanks, or click blank then click option'
A/*+ RESULT_CACHE = FALSE */
B>
Corder_date
Damount
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong comment hint syntax.
Using '<' instead of '>' for filtering.
Ordering by the wrong column.