We use cookies for site analytics. Accept to help us understand how the site is used. See our Privacy Policy for details.
Window functions compute a value across a set of related rows without collapsing them - ranking with ROW_NUMBER/RANK/DENSE_RANK, comparing to neighbors with LAG/LEAD, and running totals with SUM OVER. They're the standard tool for "top N per group" and period-over-period questions, and analytics-heavy companies treat them as the dividing line between junior and senior SQL. Every problem here is Hard for a reason - master PARTITION BY and frame semantics and the rest follows.
10 problems across 4 schemas · Premium. Each runs your query in an isolated SQLite sandbox with instant, graded feedback.
Keep the syntax at your fingertips with the free SQL quick references, then come back and solve.