Skip to content

SQL Window Functions Cheatsheet Practice Exam

Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.

📝 50 questions · ⏱ 60 minutes · 🎯 Pass mark 70% · 🆓 Free, no signup

Exam details

  • 50 questions drawn from 223 cards
  • Countdown timer — auto-submits when time runs out
  • Pass mark 70% (real certification threshold)
  • Full review of wrong answers at the end
  • No signup required — save your score with a free account

Sample Questions

5 shown

Running total of amount by user_id ordered by ts?

Show ▼

SUM(amount) OVER (PARTITION BY user_id ORDER BY ts ROWS UNBOUNDED PRECEDING)

Difference between ROW_NUMBER, RANK, DENSE_RANK?

Show ▼

ROW_NUMBER: unique sequential.
RANK: same value → same rank, leaves gaps.
DENSE_RANK: same value → same rank, no gaps.

Top N rows per group?

Show ▼

SELECT * FROM (
SELECT *, ROW_NUMBER() OVER (PARTITION BY group_id ORDER BY score DESC) rn
FROM t
) x WHERE rn <= 3;

Previous row's value in same partition?

Show ▼

LAG(price) OVER (PARTITION BY symbol ORDER BY ts)

Next row's value?

Show ▼

LEAD(price) OVER (PARTITION BY symbol ORDER BY ts)

🎯 Take the SQL Window Functions Cheatsheet Practice Exam