unnested
Explore
Pro
Sign in
Learn SQL
Window Functions
Pro
24 questions
Unlock all 24 questions with a Pro subscription.
Upgrade to Pro
Output
Easy
PARTITION BY: does the counter reset per group?
Output
Easy
ROW_NUMBER: what order determines the rank?
Output
Medium
RANK vs ROW_NUMBER on ties
Output
Medium
DENSE_RANK on ties: what comes after two 1s?
Output
Medium
SUM with an empty OVER clause: how many rows collapse?
Output
Medium
ORDER BY inside OVER: does SUM accumulate?
Output
Medium
NTILE: which bucket does each row land in?
Output
Medium
LAG with offset > 1
Multiple choice
Medium
Multiple window functions in one query
Multiple choice
Medium
Window function vs GROUP BY
Output
Medium
NTILE with uneven bucket sizes
Multiple choice
Medium
Can you mix window functions and GROUP BY?
Multiple choice
Medium
Named windows with the WINDOW clause
Vocabulary
Medium
What does PARTITION BY do in a window function?
Output
Hard
LAG: which row does it look back to?
Output
Hard
Top-N per group with window functions
Output
Hard
PERCENT_RANK: which direction puts Alice at 0.0?
Multiple choice
Hard
NULLs in window ORDER BY
Multiple choice
Hard
Frame clauses: how many rows does 1 PRECEDING cover?
Output
Hard
FIRST_VALUE: same anchor row for every row?
Multiple choice
Hard
Why LAST_VALUE surprises developers
Multiple choice
Hard
Top-N per group: why a subquery is needed
Multiple choice
Hard
ROWS vs RANGE frame modes
Vocabulary
Hard
What is a window frame?