0
0
MySQLquery~5 mins

DROP and TRUNCATE behavior in MySQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the DROP command do in MySQL?
DROP removes a table and all its data permanently from the database. The table structure and data are deleted.
Click to reveal answer
beginner
What is the main difference between DROP and TRUNCATE?
DROP deletes the entire table and its data, while TRUNCATE deletes only the data but keeps the table structure for reuse.
Click to reveal answer
intermediate
Does TRUNCATE in MySQL log individual row deletions?
No, TRUNCATE is faster because it does not log individual row deletions. It deallocates data pages instead.
Click to reveal answer
intermediate
Can you rollback a DROP command in MySQL?
No, DROP is a DDL command and cannot be rolled back once executed.
Click to reveal answer
intermediate
What happens to auto-increment counters when you TRUNCATE a table?
TRUNCATE resets the auto-increment counter to its start value in MySQL.
Click to reveal answer
Which command removes a table and its data permanently in MySQL?
AUPDATE
BTRUNCATE
CDELETE
DDROP
What does TRUNCATE do to the table structure?
ARenames the table
BDeletes the table structure
CKeeps the table structure intact
DBacks up the table
Can you undo a TRUNCATE command using ROLLBACK in MySQL?
ANo, TRUNCATE cannot be rolled back
BOnly for InnoDB tables
COnly if inside a transaction
DYes, always
Which command is faster for deleting all rows in a table?
ADELETE without WHERE
BTRUNCATE
CDROP
DUPDATE
What happens to the auto-increment value after TRUNCATE?
AIt resets to the start value
BIt doubles
CIt stays the same
DIt becomes NULL
Explain the differences between DROP and TRUNCATE commands in MySQL.
Think about what happens to the table and data after each command.
You got /5 concepts.
    Describe what happens internally when you use TRUNCATE on a MySQL table.
    Focus on performance and logging differences.
    You got /5 concepts.