Skip to content

SQL Delete

DELETE removes rows from a table. WHERE chooses which rows go; the table itself stays.

DELETE FROM table_name
WHERE condition;

The examples use the Invoices table from the example database.

Invoice 1004 was raised in error. To remove it:

DELETE FROM Invoices
WHERE InvoiceID = 1004;

Three invoices remain:

InvoiceID Supplier
1001 Hartwell Lighting
1002 Kestrel Catering
1003 Ashby Camera Hire

Leaving out WHERE empties the table but keeps it, with its columns, rules and indexes, ready for new rows:

DELETE FROM Invoices;

To remove the table itself, use DROP TABLE instead.