Skip to content

Instantly share code, notes, and snippets.

@tjpeter
tjpeter / SQL Movie - Rating Query Exercises Extras.sql
Last active January 23, 2023 01:56
StanfordOnline - Databases: Relational Databases and SQL
--- 1. Find the names of all reviewers who rated Gone with the Wind.
SELECT DISTINCT name
FROM Movie
JOIN rating USING(mID)
JOIN reviewer USING(rID)
WHERE title = "Gone with the Wind";
--- 2. For any rating where the reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars.