Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Window functions and GROUP BY
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.