juniorMySQL

TRUNCATE vs DELETE

Updated May 4, 2026

Short answer

TRUNCATE is DDL (fast/resets); DELETE is DML (slower/conditional).

Deep explanation

TRUNCATE drops and recreates the table, resetting AUTO_INCREMENT. DELETE logs every row removal individually and supports WHERE clauses.

Real-world example

Clearing a log table daily with TRUNCATE; removing specific users with DELETE.

Common mistakes

  • Using DELETE without a WHERE clause to clear a huge table, which is far slower than TRUNCATE.

Follow-up questions

  • Can TRUNCATE be rolled back?

More MySQL interview questions

View all →