with t as (
select c.name category, f.title, count(1) as rentals_count, dense_rank() over(partition by c.name order by count(1) desc) as r
from category c
join film_category fc on c.category_id = fc.category_id
join film f on fc.film_id = f.film_id
join inventory i on f.film_id = i.film_id
join rental r on i.inventory_id = r.inventory_id
where r.rental_date like '2005%'
group by c.name, f.title
)
select category,
group_concat(title) most_rented_films,
rentals_count
from t
where r = 1
group by category, rentals_count