Exercise 1.a solution notes

Here is one way to solve the problem:

SELECT name, count(*) AS total
FROM people
JOIN credits  ON credits.person_id = people.id AND type = 'writer'
JOIN genres ON genres.movie_id = credits.movie_id AND genre = 'Drama'
GROUP BY name
ORDER BY total desc, name
LIMIT 10;

This query produces the output:

NAME                    TOTAL
----------------------  -----
Coen, Ethan                 3
Coen, Joel                  3
Chazelle, Damien            2
CuarĂ³n, Alfonso             2
Hornby, Nick (I)            2
Linklater, Richard          2
Morgan, Peter (I)           2
Nolan, Christopher (I)      2
Russell, David O.           2
Sorkin, Aaron               2