DELETE removes rows from a table. WHERE chooses which rows go; the table itself stays.
DELETE FROM table_nameWHERE condition;The examples use the Invoices table from the example database.
Deleting one row
Section titled “Deleting one row”Invoice 1004 was raised in error. To remove it:
DELETE FROM InvoicesWHERE InvoiceID = 1004;Three invoices remain:
| InvoiceID | Supplier |
|---|---|
| 1001 | Hartwell Lighting |
| 1002 | Kestrel Catering |
| 1003 | Ashby Camera Hire |
Deleting every row
Section titled “Deleting every row”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.