Multiple choice technology databases

The difference between the DELETE and TRUNCATE SQL clauses is

  1. The TRUNCATE clause deletes all rows in a database table, while the DELETE clause can have a WHERE condition and might or might not delete all rows in a table

  2. The TRUNCATE clause is identical to the DELETE clause

  3. The DELETE clause deletes all rows in a database table, while the TRUNCATE clause can have a WHERE condition and might or might not delete all rows in a table

  4. None of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

TRUNCATE removes all rows from a table without a WHERE clause and cannot be conditional, while DELETE can use WHERE to selectively remove rows. TRUNCATE is faster and resets identity values, whereas DELETE logs individual row deletions.

AI explanation

TRUNCATE is a DDL operation that removes all rows from a table unconditionally (and resets storage), while DELETE is a DML operation that can include a WHERE clause, letting you remove a subset of rows or, if no condition is given, all of them. This distinction — TRUNCATE always clears everything, DELETE is conditional — is the key practical difference between the two.