The DELETE statement removes rows from a table. Like UPDATE, its syntax is simple — but it carries the same critical requirement: without a WHERE clause, it doesn't delete "some" rows, it deletes all of them.

Basic Syntax

DELETE FROM employees
WHERE id = 104;

Result:

Query OK, 1 row affected

You can delete multiple rows that match a broader condition just as easily:

-- Remove everyone who left the Sales department
DELETE FROM employees
WHERE department = 'Sales' AND status = 'Terminated';

The Same WHERE-Clause Warning, With Higher Stakes

Exactly as with UPDATE, leaving off the WHERE clause doesn't limit the statement — it removes it:

-- DANGER: no WHERE clause — every row in the table is gone
DELETE FROM employees;

Result:

Query OK, 47 rows affected

Unlike UPDATE, a mistaken DELETE is often unrecoverable unless you're working inside a transaction you haven't committed yet, or you have a recent backup. In a production environment, it's standard practice to wrap a risky DELETE in a transaction, verify the row count with a matching SELECT first, and only then commit.

DELETE vs TRUNCATE

If your actual goal is to empty an entire table, TRUNCATE TABLE is usually the better tool than an unfiltered DELETE:

TRUNCATE TABLE employees;

TRUNCATE is typically much faster than DELETE for clearing a whole table (it doesn't log each row individually), resets any auto-incrementing ID counter back to its starting value, and in most databases can't be filtered with a WHERE clause — it's all-or-nothing by design, which at least makes its intent unambiguous.