DELETE Statement
DELETE removes rows from a table. A WHERE clause decides which rows go; without one, DELETE empties the entire table.
SQL
Like UPDATE, DELETE is dangerous without a WHERE clause. It is good practice to first run a SELECT with the same condition to confirm exactly which rows will be removed.
Wrapping a delete in a transaction lets you roll it back if something goes wrong before you commit.
Syntax
DELETE FROM table_name WHERE condition;Examples
SQL
DELETE FROM users
WHERE age < 18;Output:
3 rows deleted.