In 9.sql, write a SQL query to list the names of all people who starred in a movie released in 2004, ordered by birth year.
...Your query should output a table with a single column for the name of each person.
...People with the same birth year may be listed in any order.
...No need to worry about people who have no birth year listed, so long as those who do have a birth year are listed in order.
...If a person appeared in more than one movie in 2004, they should only appear in your results once.
I don't understand why my code only outputs one name instead of the 17k+ it is supposed to. Any/all help with understanding this problem is appreciated!
My code is below:
SELECT DISTINCT name FROM people WHERE id =
(SELECT person_id FROM stars WHERE movie_id = (SELECT id FROM movies WHERE year = 2004))
ORDER BY birth;
where movie_id IN ...
and not=
??? Disclaimer: I haven't done or even read this pset yet. I'm just a humble database engineer. ;-)in
too?