The SQL DELETE statement removes existing rows from a table. Like UPDATE, it is a DML (Data Manipulation Language) command and requires careful use of the WHERE clause to avoid deleting unintended data.
Basic Syntax
The DELETE statement specifies the table name and an optional WHERE clause. When the WHERE clause is omitted, all rows in the table are deleted — the table structure remains, but it becomes empty.
DELETE is different from DROP TABLE (which removes the table entirely) and TRUNCATE TABLE (which removes all rows faster but cannot be rolled back in some configurations).
How DELETE Works
- Rows matching the WHERE condition are removed
- The auto-increment counter is NOT reset (use TRUNCATE for that)
- DELETE fires row-level triggers
- Deleted rows can be rolled back inside a transaction