select film_rank, film_title
from
(select dense_rank() over(order by count(rental_id) desc) as film_rank,
title as film_title
from rental
join inventory using(inventory_id)
join film using(film_id)
where year(rental_date) = 2005
group by 2) as t1
where film_rank < 4
order by 1, 2