0
0
Snowflakecloud~5 mins

Tasks for scheduling SQL in Snowflake - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Task in Snowflake?
A Task in Snowflake is a way to schedule and automate SQL statements to run at specific times or intervals without manual intervention.
Click to reveal answer
beginner
How do you create a simple recurring Task in Snowflake?
Use the CREATE TASK statement with a schedule clause, for example: CREATE TASK my_task WAREHOUSE = my_wh SCHEDULE = 'USING CRON 0 * * * * UTC' AS SELECT CURRENT_TIMESTAMP(); This runs every hour.
Click to reveal answer
intermediate
What is the purpose of the WAREHOUSE parameter in a Snowflake Task?
The WAREHOUSE parameter specifies which compute resource runs the SQL statements of the Task. Snowflake automatically resumes the warehouse if it is suspended.
Click to reveal answer
beginner
How can you enable or disable a Task in Snowflake?
Use ALTER TASK <task_name> RESUME; to enable and ALTER TASK <task_name> SUSPEND; to disable the Task.
Click to reveal answer
intermediate
What happens if a Task's SQL statement fails during execution?
The Task logs the failure in the TASK_HISTORY view. The Task will try to run again at the next scheduled time. Failures do not stop future executions automatically.
Click to reveal answer
Which Snowflake object is used to schedule SQL statements automatically?
AStage
BStream
CTask
DWarehouse
What is required for a Task to run its SQL statements?
AA Database
BA Stream
CA Stage
DA Warehouse
How do you stop a Task from running temporarily?
AALTER TASK <name> SUSPEND;
BDROP TASK <name>;
CCREATE TASK <name>;
DALTER TASK <name> RESUME;
Which schedule format can be used in Snowflake Tasks?
AXML format
BCRON expressions
CJSON format
DYAML format
Where can you find the history of Task executions and errors?
ATASK_HISTORY view
BINFORMATION_SCHEMA.TABLES
CWAREHOUSE_MONITOR
DQUERY_HISTORY
Explain how to create, enable, and schedule a Task in Snowflake.
Think about the SQL commands and parameters needed.
You got /4 concepts.
    Describe what happens when a Task fails and how to monitor its execution.
    Consider error handling and monitoring tools.
    You got /3 concepts.