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 directed by steven spielberg.
assistant
SELECT title FROM Movie WHERE director = 'Steven Spielberg'
human
Find the title and star rating of the movie that got the least rating star for each reviewer.
assistant
SELECT T2.title , T1.rID , T1.stars , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID
human
Find the average rating star for each movie that are not reviewed by Brittany Harris.
assistant
SELECT mID , avg(stars) FROM Rating WHERE mID NOT IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = 'Brittany Harris') GROUP BY mID
human
What are the ids of the movies that are not reviewed by Brittany Harris.
assistant
SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = 'Brittany Harris'
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 titles of all movies not reviewed by Chris Jackson.
assistant
SELECT DISTINCT title FROM Movie EXCEPT SELECT T2.title 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 = "Chris Jackson" ;