JobPrax
SQL Window functions: LAG, LEAD & running totals โ practice questions ยท JobPrax
JobPrax
Practice
Live projects
Guided projects
For colleges
Pricing
Log in
Start free
All SQL topics
SQL
Window functions: LAG, LEAD & running totals
Compare rows and accumulate values.
Your progress
0
/ 40
Start the first question
All levels
Basic (25)
Intermediate (7)
Advanced (8)
All
To do
Solved
1
Running total
Basic
2
Previous month with LAG
Basic
3
Next month with LEAD
Basic
4
Running total per group
Basic
5
Total next to each row
Basic
6
North running total
Basic
7
Last month's revenue
Basic
8
Next month's revenue
Basic
9
Total next to each row
Basic
10
Department salary total
Basic
11
Department average
Basic
12
Team size on every row
Basic
13
Running total per region
Basic
14
Change from last month
Basic
15
Previous order date
Basic
16
Category top price
Basic
17
Gap to the priciest
Basic
18
Orders so far
Basic
19
Account 102 credits so far
Basic
20
Compared with January
Basic
21
Share of category stock
Basic
22
Next login
Basic
23
Salary bill over time
Basic
24
Region average on every row
Basic
25
Largest transaction of the account
Basic
26
Month-over-month change
Interview
Intermediate
27
3-month moving average
Interview
Intermediate
28
Share of region total
Intermediate
29
Account balance
Interview
Intermediate
30
First and last value
Intermediate
31
Months with a drop
Intermediate
32
Days since previous login
Intermediate
33
Running total that resets each month
Advanced
34
Year-to-date vs previous month
Advanced
35
Growth streaks
Interview
Advanced
36
Largest single-day balance drop
Advanced
37
Rolling 7-day active users
Advanced
38
Cumulative share (Pareto)
Interview
Advanced
39
Compare with same month average
Advanced
40
Sessions from logins
Interview
Advanced