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 total movie ratings are there?
assistant
SELECT COUNT( * ) FROM rating;
human
How many of those movies received less than 2 ratings?
assistant
SELECT COUNT( * ) FROM ( SELECT * FROM Rating GROUP BY mID HAVING COUNT( * ) < 2 );
human
Of the 14 ratings, what was the highest rating?
assistant
SELECT stars FROM Rating ORDER BY stars DESC LIMIT 1;
human
And the lowest?
assistant
SELECT stars FROM Rating ORDER BY stars aSC LIMIT 1 ;