DELETE is used to remove rows from a table. You can use it to clean up cancelled orders, spam comments, or old temporary records.
The most important warning
DELETE FROM Customers; without a WHERE clause, every customer can vanish. On a production database, always double-check your backup, your condition, and your permissions before deleting.
sql
DELETE FROM Customers
WHERE CustomerID = 4;You should see
What this code does: Deletes the single row where CustomerID = 4. Safer check: First run SELECT * FROM Customers WHERE CustomerID = 4; to see exactly which row you're about to delete. Practical note: In real apps, instead of permanently deleting a record, teams often do a soft delete by adding an is_deleted or deleted_at column.