Recall & Review
beginner
What does the DELETE command do in SQL?
DELETE removes rows from a table based on a condition. If no condition is given, it removes all rows but keeps the table structure.
Click to reveal answer
intermediate
How is TRUNCATE different from DELETE?
TRUNCATE quickly removes all rows from a table without logging individual row deletions. It resets the table but keeps its structure.
Click to reveal answer
beginner
What happens when you use DROP on a table?
DROP completely removes the table and its data from the database. The table structure and all data are deleted permanently.
Click to reveal answer
intermediate
Which command is faster for removing all rows: DELETE or TRUNCATE?
TRUNCATE is faster because it does not log each row deletion and resets the table quickly.
Click to reveal answer
advanced
Can DELETE be rolled back in a transaction? What about TRUNCATE?
DELETE can be rolled back because it logs each row deletion. TRUNCATE may not be rolled back in some databases because it is a DDL operation.
Click to reveal answer
Which SQL command removes all rows but keeps the table structure intact?
✗ Incorrect
TRUNCATE removes all rows quickly but keeps the table structure.
Which command permanently deletes the table and its data?
✗ Incorrect
DROP removes the entire table and its data from the database.
Which command logs each row deletion and can be rolled back?
✗ Incorrect
DELETE logs each row deletion and supports rollback in transactions.
Which command is generally faster for removing all rows from a table?
✗ Incorrect
TRUNCATE is faster because it does not log individual row deletions.
After using DROP on a table, what remains in the database?
✗ Incorrect
DROP removes both the table structure and data completely.
Explain the differences between TRUNCATE, DELETE, and DROP commands in SQL.
Think about what happens to the data and the table itself with each command.
You got /5 concepts.
When would you choose TRUNCATE over DELETE or DROP? Give a simple example.
Consider performance and table preservation.
You got /4 concepts.