SQL Practice
Real-life business problems on real tables. Read the scenario, write the query, and get it checked instantly.
Customers from Lahore
SELECT & Filtering
Solve challengePremium products above Rs 1,000
Sorting & Limits
Solve challengeHow many orders were cancelled?
Aggregation
Solve challengeVIP outreach in emerging markets
SELECT & Filtering
Solve challengeFive fattest margins in Electronics
Sorting & Limits
Solve challengeWhich sales channel loses the most orders?
Aggregation
Solve challengeHow long does a parcel really take?
String & Date Functions
Solve challengeSigned up, never bought
Joins
Solve challengeFlagged card payments for the fraud desk
SELECT & Filtering
Solve challengeThe five biggest paying plans right now
Sorting & Limits
Solve challengeHow healthy is the loan book?
Aggregation
Solve challengeOn time, late or still unpaid?
NULL & CASE
Solve challengePayday money by month
String & Date Functions
Solve challengeWell-paid 2025 hires in Western Europe
SELECT & Filtering
Solve challengeThe five biggest cheques in the transfer market
Sorting & Limits
Solve challengeWhere does the payroll sit?
Aggregation
Solve challengeLength of stay month by month in 2025
String & Date Functions
Solve challengeWho is still in a bed?
NULL & CASE
Solve challengeLong-haul legs over 9,000 km
SELECT & Filtering
Solve challengeThe five priciest tickets
Sorting & Limits
Solve challengeZoomi city revenue scoreboard
Aggregation
Solve challengeWhich weekday does the airline fly most?
String & Date Functions
Solve challengeHow many completed trips never got a rating?
NULL & CASE
Solve challengePremium fans in Brazil, Mexico and Turkey
SELECT & Filtering
Solve challengeThe long play playlist
Sorting & Limits
Solve challengeWhere do our listeners live?
Aggregation
Solve challengeAge groups and the people who never told us
NULL & CASE
Solve challengeHandle generator for the Q1 2026 sign-ups
String & Date Functions
Solve challengeRevenue by product category
Joins
Solve challengeCustomers who never ordered
Joins
Solve challengeDelivered orders per month
String & Date Functions
Solve challengeStars without words
NULL & CASE
Solve challengeWho pays how: payment method share
Subqueries
Solve challengePodium finish: top 3 products per category
Window Functions
Solve challengeWhich sellers get their goods sent back?
Joins
Solve challengeRepeat-purchase rate by country
CTEs & Recursion
Solve challengeMonth-over-month revenue rollercoaster
Window Functions
Solve challengeGadget and kitchen lovers who skip beauty
Set Operators
Solve challengePaying customers who never opened the product
Joins
Solve challengeWhere does the card money go?
Subqueries
Solve challengeCloudpeak MRR, month by month
CTEs & Recursion
Solve challengeRebuild the balance of account 15
Window Functions
Solve challengeAngry and behind on payments
Set Operators
Solve challengeAgeing report for overdue invoices
Analytics Patterns
Solve challengeBuild the 2025-26 league table from raw results
Analytics Patterns
Solve challengeEarning more than your manager
Joins
Solve challengeDepartments that keep patients longer than the hospital average
Subqueries
Solve challengeThe top scorer of every club (ties included)
Window Functions
Solve challengePromoted stars with a clean record
Set Operators
Solve challengeWhich department sees the most abnormal lab results?
Joins
Solve challengeBusiest routes and what they cost in minutes
Joins
Solve challengeOn-time scorecard by airline and quarter
NULL & CASE
Solve challengePassengers who out-spend the average traveller
Subqueries
Solve challengeBuilding the airport watch list with set operators
Set Operators
Solve challengeThe longest silence between two flights
Window Functions
Solve challengePeak-hour demand ranking in every city
Window Functions
Solve challengeRider cohorts by month of first trip
CTEs & Recursion
Solve challengeThe silent shelf: tracks nobody has played
Joins
Solve challengeWhich plan do customers walk away from?
Aggregation
Solve challengeTop 3 genres in every country
Window Functions
Solve challengeSuperfans who never wander off
Subqueries
Solve challengeThe comeback kids of 2026
Set Operators
Solve challengeSkip rate by device
NULL & CASE
Solve challengeThe ten most valuable subscribers
NULL & CASE
Solve challengeBest-selling product in each category
Window Functions
Solve challengeRunning total of revenue by month
Window Functions
Solve challengeEmployees paid above their department average
Subqueries
Solve challengeThe second order that beat the first
Window Functions
Solve challengeHeartbeat shoppers: gaps between orders
Analytics Patterns
Solve challengeBasket pairs: what sells together
Joins
Solve challenge30-day retention by first-order cohort
Analytics Patterns
Solve challengeBlack Friday month: the 7-day rolling average
CTEs & Recursion
Solve challengeThe typical basket: median order value by country
Window Functions
Solve challengeSeller scoreboard: three half-years side by side
Aggregation
Solve challengeThe net new MRR waterfall
Analytics Patterns
Solve challengeThree swipes in ten minutes
Window Functions
Solve challengeThe deepest balance drawdown
Window Functions
Solve challengeDoes week-one API usage predict churn?
Analytics Patterns
Solve challengeMost active card holder in every country
Window Functions
Solve challengeUpgraded, regretted, downgraded
Joins
Solve challengeThe 30-day readmission rate per department
Window Functions
Solve challengeHot streaks: each club's longest run of wins
Analytics Patterns
Solve challengeSpan of control: who really runs the org?
CTEs & Recursion
Solve challengeThe second-highest salary in every country
Window Functions
Solve challengeQuarter by quarter: how fast is Nordvik growing?
CTEs & Recursion
Solve challengePatients whose labs stayed abnormal on back-to-back tests
Analytics Patterns
Solve challengeGaps and islands: every driver's longest working streak
Window Functions
Solve challengeDrivers whose rating slid three weeks in a row
Window Functions
Solve challengeHub detection with a self join
Joins
Solve challengeLahore to New York with at most two stops
CTEs & Recursion
Solve challengeWhat does surge pricing really do?
Analytics Patterns
Solve challengeOut and back within a week: round-trip travellers
Joins
Solve challengeHow much of the fleet really flies each month?
Analytics Patterns
Solve challengeSessionization: the ten longest listening sessions
Window Functions
Solve challengeLongest listening streak (gaps and islands)
Analytics Patterns
Solve challengeMonth-1 and month-2 retention by sign-up cohort
Analytics Patterns
Solve challengeFilling the empty days: May 2026 daily plays
CTEs & Recursion
Solve challengeListeners on a three-month growth run
Joins
Solve challengeVIP outreach: the top 10 percent of listeners
Window Functions
Solve challengeNew versus returning listeners, month by month
CTEs & Recursion
Solve challenge