DELETE
DELETE is a SQL statement in the DML Statements category. Removes rows from a table. Always use WHERE to avoid deleting all rows. The syntax is DELETE FROM table_name WHERE condition;. It returns number of rows deleted. A typical example: DELETE FROM employees WHERE id = 123; DELETE FROM logs WHERE created_at < DATE_SUB(NOW(), INTERVAL 30 DAY); A close relative is INSERT INTO, which inserts new rows into a table. A close relative is UPDATE, which modifies existing rows in a table. Always use WHERE to avoid updating all rows. A close relative is REPLACE INTO, which iNSERT, but if a UNIQUE/PRIMARY KEY conflict exists, DELETES the old row and inserts a new one. MySQL-specific. More about this category: Data Manipulation Language — INSERT, UPDATE, DELETE, REPLACE, MERGE. Related DML Statements entries: INSERT INTO, UPDATE, REPLACE INTO, INSERT ... ON DUPLICATE KEY UPDATE, MERGE, INSERT INTO SELECT, UPSERT (PostgreSQL), DELETE with JOIN.