0
0
SQLquery~5 mins

TRUNCATE vs DELETE vs DROP in SQL - Quick Revision & Key Differences

Choose your learning style9 modes available
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?
ATRUNCATE
BDELETE
CALTER
DDROP
Which command permanently deletes the table and its data?
AUPDATE
BTRUNCATE
CDELETE
DDROP
Which command logs each row deletion and can be rolled back?
ATRUNCATE
BDROP
CDELETE
DCREATE
Which command is generally faster for removing all rows from a table?
ADROP
BTRUNCATE
CDELETE
DINSERT
After using DROP on a table, what remains in the database?
ANothing
BTable data only
CTable structure only
DBoth structure and data
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.