0
0
Snowflakecloud~10 mins

Tasks for scheduling SQL 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 scheduled task that runs every hour.

Snowflake
CREATE OR REPLACE TASK hourly_task
  WAREHOUSE = my_warehouse
  SCHEDULE = [1]
AS
  SELECT CURRENT_TIMESTAMP();
Drag options to blanks, or click blank then click option'
A'1 MINUTE'
B'1 DAY'
C'1 HOUR'
D'10 MINUTES'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '1 MINUTE' runs the task too frequently.
Using '1 DAY' runs the task too rarely.
2fill in blank
medium

Complete the code to enable the scheduled task after creation.

Snowflake
ALTER TASK hourly_task [1];
Drag options to blanks, or click blank then click option'
ARESUME
BSTART
CSUSPEND
DPAUSE
Attempts:
3 left
💡 Hint
Common Mistakes
Using SUSPEND prevents the task from running.
PAUSE is not a valid command for tasks.
3fill in blank
hard

Fix the error in the task creation by completing the missing clause.

Snowflake
CREATE OR REPLACE TASK daily_task
  WAREHOUSE = my_warehouse
  SCHEDULE = [1]
AS
  CALL my_procedure();
Drag options to blanks, or click blank then click option'
A'1 DAY'
B'1 MINUTE'
C'1 WEEK'
D'1 MONTH'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '1 MINUTE' runs the task too often.
Using '1 WEEK' or '1 MONTH' runs it less frequently than daily.
4fill in blank
hard

Fill both blanks to create a task that runs every 15 minutes and uses the correct warehouse.

Snowflake
CREATE OR REPLACE TASK quarter_hour_task
  WAREHOUSE = [1]
  SCHEDULE = [2]
AS
  SELECT CURRENT_DATE();
Drag options to blanks, or click blank then click option'
Amy_warehouse
B'15 MINUTES'
C15 MINUTES
Ddefault_warehouse
Attempts:
3 left
💡 Hint
Common Mistakes
Putting quotes around warehouse name.
Using wrong schedule interval.
5fill in blank
hard

Fill all three blanks to create a task that runs weekly, uses the correct warehouse, and calls the right procedure.

Snowflake
CREATE OR REPLACE TASK weekly_task
  WAREHOUSE = [1]
  SCHEDULE = [2]
AS
  CALL [3]();
Drag options to blanks, or click blank then click option'
Aanalytics_warehouse
B'1 WEEK'
Cweekly_refresh
Ddaily_refresh
Attempts:
3 left
💡 Hint
Common Mistakes
Using daily procedure name for weekly task.
Wrong warehouse name.
Incorrect schedule string.