Question: I have 3 tables, like so:

```
release (release_id, name, ...)

medium (medium_id, release_id, name, ...)

track (track_id, medium_id, title, ...)

```

Having only the release\_id, i want to be able delete both the track and the medium associated with that release\_id in one shot using one query.

Is it possible? If yes, can I get a rough template, I'll figure out the rest.

Do I need multiple delete queries?

Answer: 
Strictly speaking, yes, you need three separate delete statements.

However, if you always want the associated rows deleted from the other two tables when you delete a row from the 'release' table, you can use foreign keys and an ON DELETE CASCADE constraint on the 'release' table.

See, e.g. <http://www.mysqltutorial.org/mysql-on-delete-cascade/>
In the first line you define from which tables you want to delete in the join

```
delete r, m, t
from release r
left join medium m on m.release_id = r.release_id
left join track t on t.medium_id = m.medium_id
where r.release_id = 123

```