# DELETE — MySQL

Source: https://www.geekswithgeeks.com/en/mysql/sql-delete

> Remove rows, safely.

## Deleting rows

`DELETE FROM` removes matching rows; the table itself stays.

```sql
DELETE FROM customers
WHERE id = 3;
```

Output:

```
Query OK, 1 row affected
```

## Test with SELECT first

Before a risky `UPDATE`/`DELETE`, run the same `WHERE` clause in a `SELECT` first to confirm exactly which rows will be affected.

**Quiz:** What happens if you run `DELETE FROM customers;` with no WHERE?

- [ ] Nothing, MySQL requires a WHERE clause
- [x] Every row in the table is deleted
- [ ] Only the first row is deleted

*Answer:* Every row in the table is deleted. MySQL doesn't require WHERE — omitting it deletes all rows.
