I found these steps helpful:
- Get the ID of Kevin Bacon, with the criteria that it's the Kevin Bacon who was born in 1958
- Get the movie IDs of Kevin Bacon using his ID (hint: linking his ID in table1 with table2)
- Get other stars' IDs with the same movie IDs
- Get the name of these stars, and exclude Kevin Bacon (because the spec says he shouldn't be included in the resulting list)
Note: In the first line of your code, instead of COUNT(name)
, you can use SELECT name
to get the people's names