SQL interview problems
Every problem runs against a realistic dataset in your browser. Problems marked free need no account.
0 / 70 solved
- Revenue by Product CategoryfreeAggregation & GROUP BY · Joinseasy
- Customers Who Never OrderedfreeJoinseasy
- Monthly Revenue TrendfreeDates & Time · Aggregation & GROUP BYeasy
- Average Order Value by CountryfreeAggregation & GROUP BY · Subqueries & CTEseasy
- Products Priced Above Their Category AverageWindow Functions · Subqueries & CTEseasy
- Most Recent Order per CustomerWindow Functions · Ranking & Top-N per Groupeasy
- Completed Trips and Gross Fares by CityfreeAggregation & GROUP BYeasy
- Cancellation Rate by CityfreeConditional Aggregationeasy
- Fare per Kilometer by Vehicle TypeJoins · Aggregation & GROUP BYeasy
- Trip Requests by Hour of DayDates & Time · Aggregation & GROUP BYeasy
- Drivers with Low RatingsAggregation & GROUP BY · Joinseasy
- Repeat Rider-Driver PairsAggregation & GROUP BYeasy
- Drivers with No Completed Trips in MarchfreeJoins · Subqueries & CTEseasy
- Signups by Acquisition ChannelfreeAggregation & GROUP BYeasy
- Daily Active Users in MarchDates & Time · Aggregation & GROUP BYeasy
- Power Users in MarchAggregation & GROUP BY · Dates & Timeeasy
- Current MRR by PlanAggregation & GROUP BY · Dates & Timeeasy
- Accounts with More Than 5 UsersAggregation & GROUP BY · Joinseasy
- Account Activity SummaryJoins · Aggregation & GROUP BYeasy
- Click-Through Rate by ChannelfreeAggregation & GROUP BY · Joinseasy
- Cost per Click by CampaignAggregation & GROUP BY · Joinseasy
- Days with Impressions but No ClicksAggregation & GROUP BY · Joinseasy
- Unique Clickers per DayDates & Time · Aggregation & GROUP BYeasy
- Reconcile Daily Clicks with Click LogsJoins · Aggregation & GROUP BYeasy
- Quarterly Cancellation RateConditional Aggregation · Dates & Timemedium
- Top 2 Products in Each CategoryfreeWindow Functions · Ranking & Top-N per Groupmedium
- Repeat Purchase RateSubqueries & CTEs · Aggregation & GROUP BYmedium
- Days from Signup to First OrderDates & Time · Subqueries & CTEsmedium
- Running Revenue Total for 2025Running Totals & Rolling Windows · Window Functionsmedium
- Month-over-Month Revenue GrowthWindow Functions · Dates & Timemedium
- Referrals Within the Same CountrySelf-Joinsmedium
- Referral LeaderboardSelf-Joins · Aggregation & GROUP BYmedium
- Time Between First and Second OrderWindow Functions · Dates & Timemedium
- Returned Value Share by CategoryConditional Aggregation · Joinsmedium
- Top 2 Earning Drivers in Each CityWindow Functions · Ranking & Top-N per Groupmedium
- Outcome of Riders' First RequestWindow Functions · Aggregation & GROUP BYmedium
- Weekly Active RidersDates & Time · Aggregation & GROUP BYmedium
- Riders Active in January but Not MarchSubqueries & CTEs · Dates & Timemedium
- Longest Completed Trip in Each CityWindow Functions · Ranking & Top-N per Groupmedium
- Five-Star Share by Vehicle TypeConditional Aggregation · Joinsmedium
- 7-Day Activation Rate by ChannelFunnels & Activation · Joinsmedium
- DAU/MAU Stickiness for MarchDates & Time · Subqueries & CTEsmedium
- Hours from Signup to First ProjectDates & Time · Subqueries & CTEsmedium
- Churned Accounts and Lost MRRWindow Functions · Dates & Timemedium
- Team to Business UpgradesSelf-Joins · Dates & Timemedium
- Paying Accounts with No Recent ActivitySubqueries & CTEs · Dates & Timemedium
- Event Mix by Acquisition ChannelConditional Aggregation · Joinsmedium
- Each Campaign's Share of Channel SpendWindow Functions · Aggregation & GROUP BYmedium
- Campaigns That Overspent Their BudgetConditional Aggregation · Joinsmedium
- Week-over-Week Spend by ChannelWindow Functions · Dates & Timemedium
- Users Who Clicked Ads on Every ChannelJoins · Aggregation & GROUP BYmedium
- Click-to-Purchase Rate by CampaignJoins · Subqueries & CTEsmedium
- Hours from First Click to PurchaseDates & Time · Subqueries & CTEsmedium
- Best Day for Each CampaignWindow Functions · Ranking & Top-N per Groupmedium
- 90-Day Repeat Rate by First-Order CohortRetention & Cohorts · Subqueries & CTEshard
- Frequently Bought TogetherSelf-Joins · Aggregation & GROUP BYhard
- Customers Who Bought in Every Quarter of 2025Subqueries & CTEs · Dates & Timehard
- Customers Who Make Up Half of RevenueRunning Totals & Rolling Windows · Window Functionshard
- Riders with 3-Day Ride StreaksGaps & Islands · Window Functionshard
- Average Idle Time Between TripsWindow Functions · Dates & Timehard
- Hours with Above-Average PricingSubqueries & CTEs · Dates & Timehard
- Median Fare by CityWindow Functions · Aggregation & GROUP BYhard
- New vs Returning Riders by MonthRetention & Cohorts · Subqueries & CTEshard
- Ordered Activation FunnelfreeFunnels & Activation · Subqueries & CTEshard
- Weekly Signup Cohort RetentionRetention & Cohorts · Dates & Timehard
- Sessionize Events with a 30-Minute GapWindow Functions · Gaps & Islandshard
- Rolling 7-Day CTR for Brand SearchWindow Functions · Running Totals & Rolling Windowshard
- Last-Touch Attribution by ChannelfreeMarketing Attribution · Window Functionshard
- First-Touch Attribution with a 14-Day LookbackMarketing Attribution · Window Functionshard
- Linear Attribution and ROAS by ChannelMarketing Attribution · Subqueries & CTEshard