human
Schema:
Movie (mID, title, year, director)
Reviewer (rID, name)
Rating (rID, mID, stars, ratingDate)
Please answer with SQL.
assistant
Sure, I understand.
human
How many movies were made before 2000?
assistant
SELECT count(*) FROM Movie WHERE YEAR < 2000
human
What are the names of the directors who made exactly one movie?
assistant
SELECT director FROM Movie GROUP BY director HAVING count(*) = 1
human
What is the name of the most recent movie?
assistant
SELECT title FROM Movie WHERE YEAR = (SELECT max(YEAR) FROM Movie)
human
What are names of the movies that are either made before 1980 or directed by James Cameron?
assistant
SELECT title FROM Movie WHERE director = 'James Cameron' OR YEAR < 1980
human
Find the titles of all movies directed by steven spielberg.
assistant
SELECT title FROM Movie WHERE director = 'Steven Spielberg'
human
What are the names of all movies that were created after the most recent Steven Spielberg film?
assistant
SELECT title FROM Movie WHERE YEAR > ( SELECT MAX( YEAR ) FROM Movie WHERE director = "Steven Spielberg" ) ;