Case File: The League Table
Rankings, running totals and 'compared with last month' all need to look at other rows while keeping each row. In a real SQLite database in this page, build the league tables with window functions: the three best parcels in each city with ROW_NUMBER, a running total by month, the change from the previous month with LAG, the customers ranked with RANK (ties share a place), and the gap to the customer just above. The database is generated for you alone.
Case File: The League Table
Rankings, running totals and 'compared with last month' all need to look at other rows while keeping each row. In a real SQLite database in this page, build the league tables with window functions: the three best parcels in each city with ROW_NUMBER, a running total by month, the change from the previous month with LAG, the customers ranked with RANK (ties share a place), and the gap to the customer just above. The database is generated for you alone.
In this lesson:
- sql
- sqlite
- window functions
- rank
- row_number
- lag
- running total
- case-file
This lesson is part of a paid plan
Upgrade to Pro to unlock this course, its labs and its exam.
View Pricing Plans