Wednesday, April 11, 2012

SQL query from www.db-class.com

I'm solving www.db-class.com exercises. Even though it's late the questions are still interesting. I stumbled upon last task in extras and cannot figure out the solution.



The SQL scheme is as follows:




create table Movie(mID int, title text, year int, director text);



create table Reviewer(rID int, name text);



create table Rating(rID int, mID int, stars int, ratingDate date);




The question is the following:




Q12 For each director, return the director's name together with the
title(s) of the movie(s) they directed that received the highest
rating among all of their movies, and the value of that rating.
Ignore movies whose director is NULL.




Thank you.





No comments:

Post a Comment