Exploring nationality and gender of actors
For each movie in the database, the three most important actors are identified and listed in the table actors
. This table includes the nationality
and gender
of the actors. We are interested in how much diversity there is in the nationalities of the actors and how many actors and actresses are in the list.
This exercise is part of the course
Data-Driven Decision Making in SQL
Exercise instructions
- Count the number of actors in the table
actors
from each country, the number of male and female actors and the total number of actors.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
SELECT
___ -- Select nationality of the actors
___ -- Select gender of the actors
___ -- Count the number of actors
FROM actors
GROUP BY GROUPING SETS ((___), (___), (___)); -- Use the correct GROUPING SETS operation