The UNDROP command recovers a dropped object, such as a table or schema, restoring it to its state before deletion.
Click to reveal answer
beginner
Which types of objects can you recover using UNDROP in Snowflake?
You can recover tables, schemas, and databases that were dropped, as long as they are within the retention period.
Click to reveal answer
intermediate
What is the retention period for dropped objects in Snowflake before they are permanently deleted?
Dropped objects are retained for a default period of 1 day (24 hours), but this can be extended up to 90 days depending on account settings.
Click to reveal answer
intermediate
How do you find the name of a dropped object to use with UNDROP?
You can use the SHOW <object_type> HISTORY command (where <object_type> is TABLES, SCHEMAS, or DATABASES) to see recently dropped objects and their names.
Click to reveal answer
beginner
What happens if you try to UNDROP an object that no longer exists in the dropped objects list?
The UNDROP command will fail because the object is permanently deleted and cannot be recovered.
Click to reveal answer
What is the main purpose of the UNDROP command in Snowflake?
ATo recover a dropped object
BTo permanently delete an object
CTo rename an object
DTo create a new object
✗ Incorrect
UNDROP is used to recover objects that were dropped, restoring them to their previous state.
Which of the following helps you find recently dropped objects in Snowflake?
AINFORMATION_SCHEMA.SCHEMATA
BINFORMATION_SCHEMA.TABLES
CINFORMATION_SCHEMA.COLUMNS
DSHOW TABLES HISTORY
✗ Incorrect
The SHOW TABLES HISTORY command lists objects that were recently dropped and can be recovered.
How long is the default retention period for dropped objects in Snowflake?
A90 days
B7 days
C24 hours
D30 days
✗ Incorrect
By default, dropped objects are kept for 24 hours before permanent deletion, but this can be extended up to 90 days depending on account settings.
What happens if you try to UNDROP an object after the retention period has expired?
AThe command fails because the object is permanently deleted
BThe object is recovered anyway
CThe object is renamed
DThe retention period is extended automatically
✗ Incorrect
Once the retention period expires, the object is permanently deleted and cannot be recovered.
Which of these objects can you NOT recover with UNDROP?
AA dropped table
BA dropped file in external storage
CA dropped database
DA dropped schema
✗ Incorrect
UNDROP only works for Snowflake objects like tables, schemas, and databases, not external files.
Explain how to recover a dropped table in Snowflake using the UNDROP command.
Think about how to find the dropped object and the command syntax.
You got /3 concepts.
Describe the retention period concept for dropped objects in Snowflake and its importance.
1. What is the primary purpose of the UNDROP command in Snowflake?
easy
A. To recover a dropped table, view, or schema within the retention period
B. To permanently delete a table or schema from Snowflake
C. To create a new table with the same structure as an existing one
D. To rename an existing table or schema
Solution
Step 1: Understand the function of UNDROP
The UNDROP command is designed to restore objects that were accidentally dropped, such as tables, views, or schemas.
Step 2: Identify the correct use case
Since UNDROP recovers dropped objects within the retention period, it is not used for deletion, creation, or renaming.
Final Answer:
To recover a dropped table, view, or schema within the retention period -> Option A
Quick Check:
UNDROP = Recover dropped objects [OK]
Hint: UNDROP means undo drop to restore deleted objects [OK]
Common Mistakes:
Confusing UNDROP with DELETE or DROP commands
Thinking UNDROP creates new objects
Assuming UNDROP renames objects
2. Which of the following is the correct syntax to undrop a table named sales_data in Snowflake?
easy
A. UNDROP TABLE sales_data;
B. RECOVER TABLE sales_data;
C. UNDROP TABLE IF EXISTS sales_data;
D. RESTORE TABLE sales_data;
Solution
Step 1: Recall the correct UNDROP syntax
The correct syntax to recover a dropped table is UNDROP TABLE <table_name>;
Step 2: Eliminate incorrect options
Adding IF EXISTS is invalid with UNDROP. RECOVER and RESTORE are not supported commands for recovering dropped tables in Snowflake.
Final Answer:
UNDROP TABLE sales_data; -> Option A
Quick Check:
UNDROP TABLE = correct syntax [OK]
Hint: Use UNDROP TABLE followed by the table name [OK]
Common Mistakes:
Using RECOVER or RESTORE instead of UNDROP
Adding IF EXISTS which is invalid with UNDROP
Missing the TABLE keyword
3. Consider the following sequence of commands in Snowflake:
DROP TABLE IF EXISTS customers;
UNDROP TABLE customers;
What will be the result of the UNDROP TABLE customers; command assuming the drop happened within the retention period?
medium
A. An error will occur because the table does not exist
B. The command will be ignored silently
C. The table will be restored but without any data
D. The table 'customers' will be restored with its data intact
Solution
Step 1: Understand the effect of DROP and UNDROP
The DROP TABLE command deletes the table but keeps it recoverable within the retention period. UNDROP restores the dropped table with its data.
Step 2: Confirm retention period and command behavior
Since the drop is recent and within retention, UNDROP will successfully restore the table and its data.
Final Answer:
The table 'customers' will be restored with its data intact -> Option D
Quick Check:
UNDROP restores dropped table and data [OK]
Hint: UNDROP restores table and data if within retention [OK]
Common Mistakes:
Assuming UNDROP only restores structure, not data
Thinking UNDROP fails if table was dropped
Believing UNDROP silently ignores missing tables
4. You tried to undrop a dropped schema using UNDROP SCHEMA sales_schema; but received an error. Which of the following is the most likely cause?
medium
A. You used the wrong command; UNDROP does not support schemas
B. The schema was dropped outside the retention period
C. The schema name is case-sensitive and was typed incorrectly
D. You need to run UNDROP with the database name specified
Solution
Step 1: Check retention period requirement
UNDROP only works if the object was dropped within the retention period. If dropped too long ago, recovery fails.
Step 2: Verify command support and syntax
UNDROP supports schemas, and schema names are case-insensitive by default. Database name is not required if context is set.
Final Answer:
The schema was dropped outside the retention period -> Option B
Quick Check:
Retention period exceeded causes UNDROP error [OK]
Hint: Check retention period before undropping schemas [OK]
Common Mistakes:
Assuming UNDROP can't recover schemas
Ignoring retention period limits
Mistyping schema name without checking case sensitivity
5. You accidentally dropped a table orders in your production database. You want to recover it using UNDROP, but you also want to ensure no data loss and minimal downtime. Which of the following steps is the best approach?
hard
A. Wait for the retention period to expire and then restore from a full database backup
B. Recreate the table manually and import data from backups
C. Immediately run UNDROP TABLE orders; within the retention period and verify data integrity
D. Use UNDROP TABLE orders; only after recreating the table structure
Solution
Step 1: Use UNDROP immediately after accidental drop
UNDROP recovers the dropped table with data if done within the retention period, minimizing downtime and data loss.
Step 2: Avoid manual recreation or waiting unnecessarily
Manual recreation or waiting for backup restore increases downtime and risks data loss.
Final Answer:
Immediately run UNDROP TABLE orders; within the retention period and verify data integrity -> Option C
Quick Check:
UNDROP quickly recovers dropped tables with data [OK]
Hint: Run UNDROP immediately after drop to avoid data loss [OK]
Common Mistakes:
Delaying UNDROP beyond retention period
Recreating table manually before undropping
Ignoring data verification after recovery
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.