Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- c.name AS name_category,
- COUNT(fc.film_id) AS total_films
- FROM
- category AS c
- INNER JOIN film_category AS fc ON fc.category_id = c.category_id
- WHERE
- fc.film_id IN (
- SELECT
- m.film_id
- FROM
- movie AS m
- INNER JOIN film_actor AS fa ON fa.film_id = m.film_id
- WHERE
- m.release_year > 2013
- GROUP BY
- m.film_id
- HAVING
- COUNT(fa.actor_id) > 7
- )
- GROUP BY
- name_category
- ORDER BY
- total_films DESC,
- name_category
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement