Databases · Junior · Question 34 of 75
What is the difference between DELETE FROM logs and TRUNCATE logs?
- 1
TRUNCATEdeletes only rows older than a day - ✓Correct answer:
TRUNCATEremoves all rows at once, much faster, without scanning rows or firing row triggers - 3
DELETEremoves the table itself
Explanation
DELETE can have a WHERE and removes rows one by one. DROP TABLE removes the table structure too.