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?
✗ Incorrect
DROP deletes the entire table and its data permanently.
What does TRUNCATE do to the table structure?
✗ Incorrect
TRUNCATE deletes data but keeps the table structure for reuse.
Can you undo a TRUNCATE command using ROLLBACK in MySQL?
✗ Incorrect
TRUNCATE is a DDL command and cannot be rolled back.
Which command is faster for deleting all rows in a table?
✗ Incorrect
TRUNCATE is faster because it deallocates data pages without logging each row deletion.
What happens to the auto-increment value after TRUNCATE?
✗ Incorrect
TRUNCATE resets the auto-increment counter to its initial value.
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.