Skip to content

Why These 30?

Hand-curated for maximum interview ROI.

Every Window Pattern, Composed

Six stages covering ranking (ROW_NUMBER, RANK), positional comparison (LAG), running totals (SUM OVER), rolling moving averages (AVG OVER ROWS BETWEEN), partitioned Top-N, and NTILE quartile bucketing — the windows real interview rounds reach for.

Multi-Window Composition Per Problem

Most problems compose 2–3 window functions in a single query — the realistic interview shape. You learn to layer windows on top of each other, not just memorize one-off syntax.

Real Time-Series Data on Industry Schemas

Every problem runs on real timestamped events — payments, sessions, ad impressions, support tickets. The shape of data window functions are actually used on, not toy 10-row tables.

Skill Coverage

How the 30 problems distribute across SQL topics.

ROW_NUMBER()
10
RANK()
5
LAG()
5
Running Totals (SUM OVER)
2
Moving Averages (AVG OVER ROWS BETWEEN)
3
NTILE() Bucketing
5

FAQ

No, but it helps.

LDS SQL 50 introduces every pattern at least once across its 50 problems; this deep dive then drills exclusively on window functions across 30 focused exercises.

If you struggled with Stage 3 of SQL 50 (the windows stage), this collection is exactly the remediation.

Ready to Master SQL?

Start with Stage 1 — graded instantly in your browser.

All company names, logos, and trademarks are the property of their respective owners. Their use is for identification purposes only and does not imply endorsement.

LDS SQL Window Functions 3030 Curated SQL Problems

A 6-stage progression through ROW_NUMBER, RANK, LAG, running totals, moving averages, Top-N per partition, and NTILE bucketing — composed across 15 production-grade schemas. The pattern that separates intermediate from senior SQL candidates in onsite rounds, and the one most people can fake their way around until they can't.

Problems included in LDS SQL Window Functions 30

  1. Guest Booking Sequence Number
  2. Customer Order Sequence Number
  3. Customer Order Sequence Number
  4. Customer Charge Sequence Number
  5. Number Posts per User Chronologically
  6. Rank Accounts by Balance Within Account Type
  7. Rank Portfolios by Value Per User
  8. Rank Properties by Total Revenue
  9. Rank Carriers by Shipment Volume
  10. Provider Claim Rank Within Specialty
  11. Order Value Change From Prior Order
  12. Fare Change From Previous Trip
  13. Charge Amount Change From Previous
  14. Time Gap Between Consecutive Messages
  15. Bill Amount Change From Previous Month
  16. Cumulative Principal Paid per Loan
  17. Trade Running Total Per Portfolio
  18. Invoice Amount 3-Period Moving Average
  19. Price Change 3-Event Moving Average
  20. Campaign CTR With 7-Day Moving Avg
  21. Top 2 Expensive Clicks per Campaign
  22. Top Two Transactions per Customer by Amount
  23. Most Expensive Listing per City
  24. Top Product per Category by Revenue
  25. Top Title per Genre by Rating
  26. Shipment Weight Quartile Analysis
  27. Listing Price Quartile Analysis
  28. Organization Usage Quartile Analysis
  29. User Watch Time Quartile Analysis
  30. User Engagement Quartile Analysis