A Snowflake administrator needs to recover a table that was accidentally dropped 5 days ago. The table was created as a PERMANENT table in an Enterprise Edition account, and the schema's DATA_RETENTION_TIME_IN_DAYS is set to 7. Which command will successfully restore the table?
- A. RESTORE TABLE my_schema.my_table AT (OFFSET => -432000);
- B. UNDROP TABLE my_schema.my_table;✓ Correct
- C. CREATE TABLE my_schema.my_table CLONE my_schema.my_table BEFORE (STATEMENT => '<drop_statement_id>');
- D. ALTER TABLE my_schema.my_table UNDELETE;
Explanation
UNDROP TABLE is the correct command to restore a dropped table within its Time Travel retention period. Since the table is permanent on Enterprise Edition with a 7-day retention, the 5-day-old drop is still within the window. — ALTER TABLE ... UNDELETE is not valid Snowflake syntax. — RESTORE TABLE is not a Snowflake DML command. — CREATE TABLE ... CLONE with BEFORE can recreate the table's data from Time Travel history, but this would create a new clone object rather than restoring the original table in place, and it requires referencing the dropped object with its ID (BEFORE STATEMENT syntax), which is a more complex workaround, not the canonical recovery command.