-- Find all rentals in January 2024
select media.title, rentals.due_at, customers.first_name, customers.last_name
from rentals
inner join media on media.id = rentals.media_id
inner join customers on customers.id = rentals.customer_id
inner join categories on categories.id = media.category_id
where rentals.rented_at > '2024-01-01 00:00:00'
and rentals.due_at < '2024-02-01 00:00:00';

-- Find all rentals for Documentaries
select media.title, rentals.due_at, customers.first_name, customers.last_name
from rentals
inner join media on media.id = rentals.media_id
inner join customers on customers.id = rentals.customer_id
inner join categories on categories.id = media.category_id
and categories.title = 'Documentary';

-- Find all media in the Action category
select media.*
from media
inner join categories on categories.id = media.category_id
and categories.title = 'Action';
