0
0
Snowflakecloud~10 mins

Task trees and dependencies 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 task that runs every hour.

Snowflake
CREATE OR REPLACE TASK hourly_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 HOUR'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '1 MINUTE' runs the task too frequently.
Using '1 DAY' or '1 WEEK' runs the task less often than required.
2fill in blank
medium

Complete the code to set a task dependency on another task.

Snowflake
CREATE OR REPLACE TASK dependent_task
  WAREHOUSE = my_warehouse
  AFTER [1]
AS
  CALL another_procedure();
Drag options to blanks, or click blank then click option'
Amy_procedure
Bnon_existing_task
Chourly_task
Dmy_warehouse
Attempts:
3 left
💡 Hint
Common Mistakes
Using a procedure name instead of a task name.
Using a warehouse name instead of a task name.
3fill in blank
hard

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

Snowflake
CREATE OR REPLACE TASK my_task
  WAREHOUSE = my_warehouse
  [1]
AS
  CALL my_procedure();
Drag options to blanks, or click blank then click option'
AWHEN SYSTEM$STREAM_HAS_DATA('my_stream')
BSCHEDULE = '1 DAY'
CRUN ONCE
DAFTER my_task
Attempts:
3 left
💡 Hint
Common Mistakes
Using AFTER with the same task name causes a circular dependency.
RUN ONCE is not a valid clause in Snowflake task creation.
The WHEN clause requires a SCHEDULE or AFTER clause and does not fix the missing requirement alone.
4fill in blank
hard

Fill both blanks to create a task tree where task_b runs after task_a and task_c runs after task_b.

Snowflake
CREATE OR REPLACE TASK task_b
  WAREHOUSE = my_warehouse
  AFTER [1]
AS
  CALL procedure_b();

CREATE OR REPLACE TASK task_c
  WAREHOUSE = my_warehouse
  AFTER [2]
AS
  CALL procedure_c();
Drag options to blanks, or click blank then click option'
Atask_a
Btask_c
Ctask_b
Dtask_a_procedure
Attempts:
3 left
💡 Hint
Common Mistakes
Using procedure names instead of task names in AFTER clauses.
Creating circular dependencies by referencing tasks incorrectly.
5fill in blank
hard

Fill all three blanks to create a task that runs every day, depends on task_x, and calls the correct procedure.

Snowflake
CREATE OR REPLACE TASK daily_task
  WAREHOUSE = [1]
  SCHEDULE = [2]
  AFTER [3]
AS
  CALL daily_procedure();
Drag options to blanks, or click blank then click option'
Amy_warehouse
B'1 DAY'
Ctask_x
Ddaily_procedure
Attempts:
3 left
💡 Hint
Common Mistakes
Using procedure name in AFTER clause instead of task name.
Incorrect schedule format.