Introduction
Quick refresher
PARTITION BY ORDER BY with ranking
11. Practice 2
PARTITION BY ORDER BY with window frames
PARTITION BY ORDER BY with analytical functions
Revision

Instruction

Perfect! Another one of the way.

Exercise

For each day of the sales statistics, show the day, the store_id of the best store in terms of the revenue on that day, and that revenue.

Stuck? Here's a hint!

Remember to use temporary table.

Use RANK() OVER(PARTITION BY day ORDER BY revenue DESC).

Console

Code editor

Result

TableConsole