Bird
Raised Fist0
Snowflakecloud~20 mins

Time Travel retention periods in Snowflake - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Time Travel Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Time Travel retention limits

Snowflake's Time Travel feature allows querying historical data. What is the maximum retention period for Time Travel on a standard Snowflake account?

A1 day (24 hours)
B7 days
C90 days
D365 days
Attempts:
2 left
💡 Hint

Think about the default maximum retention period for Time Travel in Snowflake standard editions.

❓ Configuration
intermediate
1:30remaining
Setting Time Travel retention period on a table

You want to set the Time Travel retention period to 3 days on a Snowflake table named sales_data. Which SQL command correctly sets this retention period?

AALTER TABLE sales_data SET TIME_TRAVEL_RETENTION_DAYS = 3;
BALTER TABLE sales_data SET DATA_RETENTION_TIME_IN_DAYS = 3;
CALTER TABLE sales_data SET RETENTION_PERIOD = 3;
DALTER TABLE sales_data SET DATA_RETENTION_DAYS = 3;
Attempts:
2 left
💡 Hint

Look for the exact property name Snowflake uses for retention period in table alteration.

❓ Architecture
advanced
1:30remaining
Impact of Time Travel retention on storage costs

How does increasing the Time Travel retention period affect Snowflake storage costs?

AStorage costs increase because Snowflake retains more historical data for the longer retention period.
BStorage costs decrease because older data is compressed more efficiently with longer retention.
CStorage costs remain the same regardless of Time Travel retention period.
DStorage costs increase only if data is deleted, otherwise no change.
Attempts:
2 left
💡 Hint

Think about how storing more historical data affects storage usage.

❓ service_behavior
advanced
1:30remaining
Behavior of Time Travel after retention period expires

What happens if you try to query data using Time Travel after the retention period has expired?

ASnowflake returns null values for the requested historical data.
BSnowflake automatically extends the retention period and returns the data.
CSnowflake returns an error indicating the data is no longer available for Time Travel.
DSnowflake returns the latest data ignoring the Time Travel timestamp.
Attempts:
2 left
💡 Hint

Consider what happens when historical data is purged after retention.

❓ security
expert
2:00remaining
Time Travel retention and data privacy compliance

Your company must comply with data privacy laws that require permanent deletion of sensitive data within 30 days. How does Snowflake's Time Travel retention period affect compliance?

AYou must manually purge Time Travel data after 30 days to comply with deletion requirements.
BTime Travel retention does not affect data deletion; once deleted, data is immediately removed from all storage.
CYou can keep the default retention period since Time Travel data is encrypted and inaccessible to users.
DYou must set the Time Travel retention period to 0 days to ensure data is permanently deleted immediately.
Attempts:
2 left
💡 Hint

Think about how Time Travel retains deleted data and its impact on permanent deletion.

Practice

(1/5)
1. What does the Time Travel retention period in Snowflake control?
easy
A. How long you can access previous versions of data
B. How long data is stored in the cloud
C. The speed of query execution
D. The number of users who can access a table

Solution

  1. Step 1: Understand Time Travel feature

    Time Travel allows you to see and restore past versions of your data.
  2. Step 2: Identify what retention period controls

    The retention period sets how many days you can access these past versions.
  3. Final Answer:

    How long you can access previous versions of data -> Option A
  4. Quick Check:

    Retention period = access duration for past data [OK]
Hint: Retention period means how long past data is accessible [OK]
Common Mistakes:
  • Confusing retention with storage duration
  • Thinking it controls query speed
  • Assuming it limits user access
2. Which SQL command correctly sets the Time Travel retention period to 7 days for a table named sales_data?
easy
A. ALTER TABLE sales_data SET RETENTION_DAYS = 7;
B. ALTER TABLE sales_data SET DATA_RETENTION_TIME_IN_DAYS = 7;
C. UPDATE TABLE sales_data SET DATA_RETENTION_TIME_IN_DAYS = 7;
D. ALTER TABLE sales_data DATA_RETENTION = 7;

Solution

  1. Step 1: Recall correct syntax for setting retention

    The correct command uses ALTER TABLE with SET DATA_RETENTION_TIME_IN_DAYS.
  2. Step 2: Match syntax with options

    ALTER TABLE sales_data SET DATA_RETENTION_TIME_IN_DAYS = 7; matches the exact syntax; others use incorrect keywords or commands.
  3. Final Answer:

    ALTER TABLE sales_data SET DATA_RETENTION_TIME_IN_DAYS = 7; -> Option B
  4. Quick Check:

    Use ALTER TABLE ... SET DATA_RETENTION_TIME_IN_DAYS [OK]
Hint: Use ALTER TABLE ... SET DATA_RETENTION_TIME_IN_DAYS [OK]
Common Mistakes:
  • Using UPDATE instead of ALTER TABLE
  • Wrong keyword like RETENTION_DAYS
  • Missing SET keyword
3. Given a table with a Time Travel retention period of 3 days, what happens if you try to query data from 5 days ago using Time Travel?
medium
A. You get an error because data older than 3 days is not available
B. You get the data from 5 days ago without issues
C. The query runs but returns empty results
D. The retention period automatically extends to 5 days

Solution

  1. Step 1: Understand retention period limit

    Retention period limits how far back you can access data versions.
  2. Step 2: Apply to 5 days query with 3 days retention

    Since 5 days is beyond 3 days retention, data is unavailable and causes an error.
  3. Final Answer:

    You get an error because data older than 3 days is not available -> Option A
  4. Quick Check:

    Query beyond retention period = error [OK]
Hint: Cannot access data older than retention days [OK]
Common Mistakes:
  • Assuming data is always available
  • Thinking query returns empty instead of error
  • Believing retention auto-extends
4. You tried to set the Time Travel retention period to 100 days on a table, but Snowflake returned an error. What is the most likely cause?
medium
A. You need to restart the Snowflake service
B. Syntax error in the ALTER TABLE command
C. Table does not support Time Travel
D. Retention period exceeds the maximum allowed limit

Solution

  1. Step 1: Know Snowflake retention limits

    Snowflake limits Time Travel retention to a maximum (usually 1 to 90 days depending on edition).
  2. Step 2: Check if 100 days exceeds limit

    100 days is beyond typical max, causing an error.
  3. Final Answer:

    Retention period exceeds the maximum allowed limit -> Option D
  4. Quick Check:

    Retention > max limit causes error [OK]
Hint: Check max retention days allowed before setting [OK]
Common Mistakes:
  • Assuming syntax error without checking limits
  • Thinking table lacks Time Travel support
  • Believing service restart fixes retention errors
5. A company wants to keep Time Travel data for 14 days but minimize storage costs. Which approach best balances these needs?
hard
A. Set DATA_RETENTION_TIME_IN_DAYS to 30 to avoid data loss
B. Set DATA_RETENTION_TIME_IN_DAYS to 1 and rely on backups for older data
C. Set DATA_RETENTION_TIME_IN_DAYS to 14 and regularly purge old data
D. Disable Time Travel and keep manual snapshots

Solution

  1. Step 1: Understand retention vs storage cost

    Longer retention means more storage cost; shorter retention saves cost but limits recovery.
  2. Step 2: Evaluate options for 14-day retention and cost balance

    Setting retention to 14 days meets recovery needs; purging old data helps control storage.
  3. Final Answer:

    Set DATA_RETENTION_TIME_IN_DAYS to 14 and regularly purge old data -> Option C
  4. Quick Check:

    Retention matches need + purge controls cost [OK]
Hint: Match retention days to need, purge to save cost [OK]
Common Mistakes:
  • Setting retention too low losing data
  • Setting retention too high increasing cost
  • Disabling Time Travel losing recovery benefits
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard