What is the UNDROP command in Snowflake and how does it rely on Time Travel?

Quick Overview

Asks what the Snowflake UNDROP command does for a dropped table, schema or database and how it depends on Time Travel. Tests understanding of retention periods, Fail-safe, name conflicts and the limits of recovering dropped objects.

What is the UNDROP command in Snowflake and how does it rely on Time Travel?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Other

What is the `UNDROP` command in Snowflake, and how does it rely on Time Travel? Picture a teammate who has just dropped a production table by mistake and asks whether it can still be recovered. ```hint Follow the data Think about what Snowflake actually removes at the moment of a `DROP`, and which setting decides how long the rest is kept. ``` ### What a Strong Answer Covers - What a `DROP` does to the object's metadata and to its stored micro-partitions - Why restoring a dropped object is fast and copies no data - How the Time Travel retention period limits when `UNDROP` works, and what happens once it ends - The object types the command applies to and its syntax - The case where an object with the same name already exists ### Follow-up Questions - A table named `customers` was dropped, recreated and dropped again. What does `UNDROP TABLE customers` restore, and how would you get the older version back? - How would you guarantee that a critical table can be recovered for 30 days after a drop, and what does that cost? - How do transient and temporary tables change the recovery options? - When would you use a Time Travel query with `AT` or `BEFORE`, or a clone at a past point, instead of `UNDROP`?

Overview: Asks what the Snowflake UNDROP command does for a dropped table, schema or database and how it depends on Time Travel. Tests understanding of retention periods, Fail-safe, name conflicts and the limits of recovering dropped objects.

General logo
General
Nov 24, 2026
easyData ScientistOtherData Manipulation (SQL/Python)
0
0

What is the UNDROP command in Snowflake, and how does it rely on Time Travel?

Picture a teammate who has just dropped a production table by mistake and asks whether it can still be recovered.

What a Strong Answer Covers Guidance

  • What a DROP does to the object's metadata and to its stored micro-partitions
  • Why restoring a dropped object is fast and copies no data
  • How the Time Travel retention period limits when UNDROP works, and what happens once it ends
  • The object types the command applies to and its syntax
  • The case where an object with the same name already exists

Follow-up Questions Guidance

  • A table named customers was dropped, recreated and dropped again. What does UNDROP TABLE customers restore, and how would you get the older version back?
  • How would you guarantee that a critical table can be recovered for 30 days after a drop, and what does that cost?
  • How do transient and temporary tables change the recovery options?
  • When would you use a Time Travel query with AT or BEFORE , or a clone at a past point, instead of UNDROP ?