Introduction
Simple OVER()
PARTITION BY
Ranking functions
Window frame
Analytic functions
ORDER BY PARTITION BY
29. PARTITION BY ORDER BY – Exercise 2
Order of evaluation
Summary

Instruction

Unbelievable! Okay, this is going to be the very last exercise in this section.

Exercise

For each movie, show the following information: title, genre, average user rating for that movie and its rank in the respective genre based on that average rating in descending order (so that the best movies will be shown first).

Stuck? Here's a hint!

GROUP BY the title and genre and the, in the window function, partition by the genre and order by the average rating.

Console

Code editor

Result

TableConsole