Я не могу найти 'avatar2' в вашем наборе данных, но он есть в результате. Таким образом, я не смог проверить ответ на вопрос. Это запрос SQL Server, который я предложил. Надеюсь, изменений не потребуется.
WITH A as
(SELECT
year,
genre,
studio,
COUNT(*) OVER (PARTITION BY year, genre, studio) AS studio_movie_count,
title,
revenue,
SUM(revenue) OVER (PARTITION BY year, genre, studio,title) AS revenue_sum FROM movies),
B as
(SELECT
year,
DENSE_RANK() OVER (ORDER BY year DESC) AS year_num,
genre,
DENSE_RANK() OVER (PARTITION BY year ORDER BY genre ASC) AS genre_num,
studio,
DENSE_RANK() OVER (PARTITION BY year, genre ORDER BY studio_movie_count DESC) AS studio_num,
title,
DENSE_RANK() OVER (PARTITION BY year, genre, studio ORDER BY revenue_sum DESC) AS title_num,
revenue
FROM A)
SELECT year, genre, studio, title, revenue
FROM B
WHERE year_num < 3 AND
genre_num < 3 AND
studio_num < 3 AND
title_num < 3;