Explain Snowflake's Time Travel feature, its retention period, and use cases for recovery and historical analysis
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Explain Snowflake's Time Travel feature, including its configurable retention period and common use cases for data recovery or historical analysis.
```hint Three things to cover
Say how you point a query or a restore at a past moment, which setting controls how far back you can go (and what limits it), and then give one recovery scenario and one analysis scenario.
```
### What a Strong Answer Covers
- What Time Travel keeps and the ways to reach a past state of a table (query clauses, clone, restore of dropped objects)
- The setting that controls the retention window, where it can be set, its default, and the limits by edition and by table type
- Concrete recovery use cases, such as a bad `DELETE` or a dropped table
- Historical analysis use cases, such as comparing current data with an earlier snapshot
- What happens once data ages out of the window, and what keeping history costs
### Follow-up Questions
- What happens to a dropped table's data after its Time Travel window ends, and can it still be recovered?
- A table was dropped and a new table with the same name was created afterward. How do you get the old one back?
- What does a longer retention period cost, and what retention would you choose for a staging table that is rebuilt every hour?
Overview: Asks how Snowflake Time Travel works, how its retention period is configured, and where it helps with recovering data or studying past states of a table. Tests knowledge of point-in-time queries, restoring dropped objects, retention limits by edition and table type, and the storage cost of history.