Challenge - 5 Problems
Snowflake Time Travel Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate2:00remaining
Querying data at a specific point in time
You want to query the state of a table named orders exactly as it was at the timestamp '2024-01-01 12:00:00'. Which SQL query will return the correct historical data snapshot in Snowflake?
Attempts:
2 left
💡 Hint
Use the Snowflake syntax that queries the table state exactly at a given timestamp.
✗ Incorrect
In Snowflake, the
AT (TIMESTAMP => ...) clause queries the table as it existed exactly at the specified timestamp. The BEFORE clause queries data before that timestamp, and FOR SYSTEM_TIME AS OF is not valid syntax in Snowflake.❓ service_behavior
intermediate2:00remaining
Querying data before a specific timestamp
You want to retrieve all rows from the customers table as they existed strictly before '2024-03-15 08:00:00'. Which query will correctly return this data in Snowflake?
Attempts:
2 left
💡 Hint
Use the Snowflake clause that returns data before a given timestamp.
✗ Incorrect
The
BEFORE (TIMESTAMP => ...) clause in Snowflake returns the table state strictly before the specified timestamp. Filtering by created_at is not reliable for time travel queries, and FOR SYSTEM_TIME is not valid in Snowflake.🧠 Conceptual
advanced1:30remaining
Understanding Snowflake Time Travel retention
What is the default maximum time travel retention period for standard Snowflake accounts, during which historical data can be queried using AT or BEFORE clauses?
Attempts:
2 left
💡 Hint
Think about how long Snowflake keeps historical data by default for querying.
✗ Incorrect
Snowflake's default Time Travel retention period is 1 day (24 hours) for all accounts, including Standard Edition accounts. For Standard Edition, the maximum retention period is limited to 1 day and cannot be extended. Enterprise Edition (and higher) allows up to 90 days. The 7-day period refers to Fail-safe retention, which is separate and not queryable using AT or BEFORE.
❓ Architecture
advanced2:30remaining
Designing a data recovery strategy using Snowflake Time Travel
You want to design a recovery plan for accidental data deletion in a Snowflake table. Which approach best uses Snowflake's time travel feature to restore data to a point before deletion?
Attempts:
2 left
💡 Hint
Snowflake does not have a direct restore command but allows querying past data states.
✗ Incorrect
Snowflake's time travel allows querying the table as it existed at a previous timestamp using the AT clause. To recover deleted data, you query the historical data and then re-insert it. There is no direct RESTORE TABLE command or ROLLBACK TRANSACTION in Snowflake for this purpose. Filtering by a deleted flag depends on your schema and does not use time travel.
❓ security
expert2:00remaining
Access control for querying historical data in Snowflake
Which Snowflake privilege is required for a user to query a table's historical data using the AT or BEFORE clauses?
Attempts:
2 left
💡 Hint
Think about the privileges needed to read data from a table, including historical data.
✗ Incorrect
To query historical data using time travel, a user needs the SELECT privilege on the table and USAGE privilege on the database and schema. OWNERSHIP is not required just to query data. MONITOR and CREATE STAGE privileges are unrelated to querying table data.