Complete the code to set the Time Travel retention period to 7 days for a Snowflake table.
ALTER TABLE my_table SET DATA_RETENTION_TIME_IN_DAYS = [1];Setting DATA_RETENTION_TIME_IN_DAYS to 7 enables Time Travel for 7 days.
Complete the code to query the current Time Travel retention period for a Snowflake table.
SHOW TABLES LIKE 'my_table'; -- Look for retention_time in the [1] column
The retention_time column shows the Time Travel retention period.
Fix the error in the command to disable Time Travel on a Snowflake table.
ALTER TABLE my_table SET DATA_RETENTION_TIME_IN_DAYS = [1];Setting DATA_RETENTION_TIME_IN_DAYS to 0 disables Time Travel.
Fill both blanks to set Time Travel retention to 1 day and clone the table.
ALTER TABLE my_table SET DATA_RETENTION_TIME_IN_DAYS = [1]; CREATE TABLE my_table_clone CLONE my_table [2] (TIMESTAMP => CURRENT_TIMESTAMP());
Retention is set to 1 day. Cloning uses AT to specify the time for the clone.
Fill all three blanks to query the history of a table within its Time Travel retention period.
SELECT * FROM my_table [1] ([2] => CURRENT_TIMESTAMP - INTERVAL '[3] DAY');
AT instead of BEFORE for historical queries.Use BEFORE with TIMESTAMP to query data as it was 7 days ago.