Complete the code to enable result caching for a query in Snowflake.
SELECT * FROM sales WHERE region = 'US' [1];
In Snowflake, you can hint to use result caching by adding the comment hint /*+ RESULT_CACHE */ after the query.
Complete the code to check if result caching is enabled for a query in Snowflake.
SELECT query_id, result_caching FROM table(information_schema.query_history()) WHERE query_text LIKE '%[1]%';
The query_text column contains the SQL text. To find queries using SELECT statements, you filter with '%SELECT%'.
Fix the error in the query to disable result caching for a specific query.
SELECT * FROM orders [1] RESULT_CACHE = FALSE;To disable result caching for a query, use the comment hint syntax: /*+ RESULT_CACHE = FALSE */.
Fill both blanks to create a query that uses result caching and filters by region 'EU'.
SELECT * FROM sales [1] WHERE region [2] 'EU';
The comment hint /*+ RESULT_CACHE */ enables result caching. The filter uses = to select region 'EU'.
Fill all three blanks to create a query that disables result caching, filters orders with amount greater than 100, and orders results by date.
SELECT * FROM orders [1] WHERE amount [2] 100 ORDER BY [3];
The comment hint disables result caching. The filter uses '>' to select amounts greater than 100. The results are ordered by 'order_date'.