human
Schema:
Movie (mID, title, year, director)
Reviewer (rID, name)
Rating (rID, mID, stars, ratingDate)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the lowest and highest rating star?
assistant
SELECT MAX( stars ) , MIN( stars ) FROM Rating;
human
What is the movie id and rating date of the movie with 5 stars?
assistant
SELECT mID , ratingDate FROM Rating WHERE stars = 5;
human
Now show me the movie id and rating dates of the movie with 2 stars?
assistant
SELECT mID , ratingDate FROM Rating WHERE stars = 2;
human
What is the earliest rating date?
assistant
SELECT ratingDate FROM Rating WHERE ratingDate ! = 'NULL' ORDER by ratingdate LIMIT 1;
human
What is the most recent rating date?
assistant
SELECT ratingDate FROM Rating ORDER by ratingdate desc LIMIT 1 ;