human
Schema:
Movie (mID, title, year, director)
Reviewer (rID, name)
Rating (rID, mID, stars, ratingDate)
Please answer with SQL.
assistant
Sure, I understand.
human
Which movie has the highest average rating? | The title of the movie that has the highest average rating is Snow White | What is it's rating?
assistant
SELECT AVG ( T1.stars ) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG ( T1.stars ) DESC LIMIT 1;
human
What is the average rating for all movies?
assistant
SELECT T2.title , AVG ( T1.stars ) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ;