Created
October 24, 2013 20:35
-
-
Save bagvendt/7144538 to your computer and use it in GitHub Desktop.
Find every actor that has appeared in at least 20 rated movies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM ( | |
SELECT actor_id, COUNT(*) as count FROM actors | |
JOIN `roles` | |
ON actors.`id` = roles.`actor_id` | |
JOIN `movies` | |
ON movies.`id` = `movie_id` | |
WHERE rank IS NOT NULL | |
GROUP BY actor_id) a | |
WHERE a.count >= 20; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment