Evaluation Order and Common Problems
Window functions and GROUP BY
15. Practice Time!
Summary and Review

Instruction

Let's do another exercise.

Exercise

Group the auctions based on the day they ended and show the following information: EndDate, the average number of views from auctions on that day, and the ranking based on that average. The highest average should get the rank of 1. Name the last two columns AvgViews and Ranking.

Stuck? Here's a hint!

Use

RANK() OVER(ORDER BY AVG(Views) DESC

as your window function.