# DELETE — MySQL Fundamentals: SQL, Joins and Transactions

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

> Remove rows safely with DELETE and WHERE, previewing the affected rows with a SELECT first.

## 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?

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

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