SQL Practice
Real-life business problems on real tables. Read the scenario, write the query, and get it checked instantly.
Expert50 pts
Best-selling product in each category
Window Functions
Solve challengeExpert50 pts
Running total of revenue by month
Window Functions
Solve challengeExpert50 pts
Employees paid above their department average
Subqueries
Solve challengeExpert50 pts
The second order that beat the first
Window Functions
Solve challengeExpert50 pts
Heartbeat shoppers: gaps between orders
Analytics Patterns
Solve challengeExpert50 pts
Basket pairs: what sells together
Joins
Solve challengeExpert50 pts
30-day retention by first-order cohort
Analytics Patterns
Solve challengeExpert50 pts
Black Friday month: the 7-day rolling average
CTEs & Recursion
Solve challengeExpert50 pts
The typical basket: median order value by country
Window Functions
Solve challengeExpert50 pts
Seller scoreboard: three half-years side by side
Aggregation
Solve challengeExpert50 pts
The net new MRR waterfall
Analytics Patterns
Solve challengeExpert50 pts
Three swipes in ten minutes
Window Functions
Solve challengeExpert50 pts
The deepest balance drawdown
Window Functions
Solve challengeExpert50 pts
Does week-one API usage predict churn?
Analytics Patterns
Solve challengeExpert50 pts
Most active card holder in every country
Window Functions
Solve challengeExpert50 pts
Upgraded, regretted, downgraded
Joins
Solve challengeExpert50 pts
The 30-day readmission rate per department
Window Functions
Solve challengeExpert50 pts
Hot streaks: each club's longest run of wins
Analytics Patterns
Solve challengeExpert50 pts
Span of control: who really runs the org?
CTEs & Recursion
Solve challengeExpert50 pts
The second-highest salary in every country
Window Functions
Solve challengeExpert50 pts
Quarter by quarter: how fast is Nordvik growing?
CTEs & Recursion
Solve challengeExpert50 pts
Patients whose labs stayed abnormal on back-to-back tests
Analytics Patterns
Solve challengeExpert50 pts
Gaps and islands: every driver's longest working streak
Window Functions
Solve challengeExpert50 pts
Drivers whose rating slid three weeks in a row
Window Functions
Solve challengeExpert50 pts
Hub detection with a self join
Joins
Solve challengeExpert50 pts
Lahore to New York with at most two stops
CTEs & Recursion
Solve challengeExpert50 pts
What does surge pricing really do?
Analytics Patterns
Solve challengeExpert50 pts
Out and back within a week: round-trip travellers
Joins
Solve challengeExpert50 pts
How much of the fleet really flies each month?
Analytics Patterns
Solve challengeExpert50 pts
Sessionization: the ten longest listening sessions
Window Functions
Solve challengeExpert50 pts
Longest listening streak (gaps and islands)
Analytics Patterns
Solve challengeExpert50 pts
Month-1 and month-2 retention by sign-up cohort
Analytics Patterns
Solve challengeExpert50 pts
Filling the empty days: May 2026 daily plays
CTEs & Recursion
Solve challengeExpert50 pts
Listeners on a three-month growth run
Joins
Solve challengeExpert50 pts
VIP outreach: the top 10 percent of listeners
Window Functions
Solve challengeExpert50 pts
New versus returning listeners, month by month
CTEs & Recursion
Solve challenge