human
Schema:
Movie (mID, title, year, director)
Reviewer (rID, name)
Rating (rID, mID, stars, ratingDate)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the titles of all movies that have no ratings.
assistant
SELECT title FROM Movie WHERE mID NOT IN (SELECT mID FROM Rating)
human
Find the names of all directors whose movies are rated by Sarah Martinez.
assistant
SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez'
human
For all directors who directed more than one movie, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie title.
assistant
SELECT T1.title , T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title != T2.title ORDER BY T1.director , T1.title
human
For directors who had more than one movie, return the titles and produced years of all movies directed by them.
assistant
SELECT T1.title , T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title != T2.title
human
What is the names of movies whose created year is after all movies directed by Steven Spielberg?
assistant
SELECT title FROM Movie WHERE YEAR > (SELECT max(YEAR) FROM Movie WHERE director = 'Steven Spielberg')
human
Find the titles of all movies directed by steven spielberg.
assistant
SELECT title FROM Movie WHERE director = "Steven Spielberg" ;