Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Simple OVER()
PARTITION BY
12. PARTITION BY – Exercise 2
Ranking functions
Window Frames
Analytic Functions
PARTITION BY ORDER BY
Order of Evaluation
Finished!

Instruction

Well done! Let's move on to a more difficult example.

Exercise

For each distinct movie, show the Title, the average customer rating for that movie, the average customer rating for the entire genre and the average customer rating for all movies. Name the columns AvgMovieRating, AvgGenreRating and AvgRating.

Stuck? Here's a hint!

Here, join two tables: Review and Movie. You will need to partition by the MovieId and by Genre. Don't forget to use SELECT DISTINCT in your query!