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.
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 30 — 30 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
- Guest Booking Sequence Number
- Customer Order Sequence Number
- Customer Order Sequence Number
- Customer Charge Sequence Number
- Number Posts per User Chronologically
- Rank Accounts by Balance Within Account Type
- Rank Portfolios by Value Per User
- Rank Properties by Total Revenue
- Rank Carriers by Shipment Volume
- Provider Claim Rank Within Specialty
- Order Value Change From Prior Order
- Fare Change From Previous Trip
- Charge Amount Change From Previous
- Time Gap Between Consecutive Messages
- Bill Amount Change From Previous Month
- Cumulative Principal Paid per Loan
- Trade Running Total Per Portfolio
- Invoice Amount 3-Period Moving Average
- Price Change 3-Event Moving Average
- Campaign CTR With 7-Day Moving Avg
- Top 2 Expensive Clicks per Campaign
- Top Two Transactions per Customer by Amount
- Most Expensive Listing per City
- Top Product per Category by Revenue
- Top Title per Genre by Rating
- Shipment Weight Quartile Analysis
- Listing Price Quartile Analysis
- Organization Usage Quartile Analysis
- User Watch Time Quartile Analysis
- User Engagement Quartile Analysis