Free practice
SQL Interview Questions for Data Analysts
50 original interview-style problems with a real in-browser Postgres editor, instant answer checking and step-by-step solutions.
50 questions · 10 Easy · 28 Medium · 12 Hard
Showing 50 of 50 questions
- High-value UPI orders in Q1EasyWHERE & FilteringRazorpayFlipkart
- Shipments still missing a delivery timestampEasyNULL / NOT NULL HandlingOlaEXL
- Label each basket as Small, Medium or LargeEasyCASE StatementsMyntraMeesho
- Daily signups by acquisition channelEasyGROUP BYZoomInfoSwiggy
- Cities with a loyal, high-spending buyer baseMediumHAVINGWalmartTarget
- Warehouse stock summaryEasyAggregate FunctionsWalmartAmazon
- Match every order to its customerMediumJoins — Inner JoinPayPalRazorpay
- Courier partners with no shipments in FebruaryMediumJoins — Left/Right Outer JoinFlipkartRSystems
- Find every store-product listing gapHardJoins — Cross JoinTargetAmazonMeesho
- Employees earning more than their managerMediumJoins — Self JoinOracleEXL
- Second highest invoice amountMediumSubqueriesPayPalOracle
- Campaign spend efficiency with a CTEMediumCTEsSwiggyZoomInfo
- Walk the category tree and report its depthHardRecursive CTEsAmazonMyntra
- Rank support agents within their teamMediumWindow FunctionsEXLRSystemsSwiggy
- Duplicate support tickets from the same customerMediumGROUP BYZomatoTarget
- Three consecutive high-temperature readingsHardWindow FunctionsOracleWalmart
- Running revenue total by monthMediumWindow FunctionsRazorpayPayPal
- Third highest salary in every departmentHardSubqueriesOracleWalmartEXL
- Flag subscription churn riskMediumCASE StatementsZoomInfoPayPal
- Null-safe order totals with discounts and shippingMediumNULL / NOT NULL HandlingZomatoMeesho
- Products that have never been orderedMediumJoins — Left/Right Outer JoinFlipkartMyntra
- Top 3 cities by revenueMediumAggregate FunctionsSwiggyZomatoOla
- First and last purchase span per customerHardWindow FunctionsAmazonRazorpay
- Build each employee's reporting chain to the CEOHardRecursive CTEsTargetOracle
- Month-1 retention rate by signup cohortHardCTEsSwiggyMeeshoPayPal
- In-stock mid-range footwear and apparelEasyWHERE & FilteringMyntraMeesho
- Pick the best contact channel for every customerEasyNULL / NOT NULL HandlingZomatoEXL
- Classify ride pickups by waiting timeEasyCASE StatementsOlaSwiggy
- Successful payments by payment methodEasyGROUP BYRazorpayPayPal
- Price spread across shelf categoriesEasyAggregate FunctionsWalmartTarget
- Restaurants with consistently high ratingsMediumHAVINGZomatoSwiggy
- Order lines with product and category namesMediumJoins — Inner JoinAmazonFlipkart
- Weekly completed deliveries per partner, idle ones includedMediumJoins — Left/Right Outer JoinSwiggyOla
- Reconcile gateway payments with bank settlementsMediumJoins — Left/Right Outer JoinPayPalRazorpay
- Colleague pairs in the same city, different teamsMediumJoins — Self JoinOracleRSystems
- Zero-filled daily sales grid for every storeMediumJoins — Cross JoinWalmartTarget
- Orders above the customer's own averageMediumSubqueriesAmazonFlipkart
- Customers who out-spend the average customerMediumSubqueriesMeeshoMyntra
- Monthly net revenue after refundsMediumCTEsPayPalRazorpay
- Win-back orders after a long gapMediumWindow FunctionsSwiggyZomato
- Top two revenue positions per categoryMediumWindow FunctionsAmazonWalmart
- Three-day moving average of daily ordersMediumWindow FunctionsOracleWalmart
- City share of total revenue with running shareMediumWindow FunctionsZomatoOla
- Courier scorecard with conditional countsMediumCASE StatementsFlipkartEXL
- Customers who ordered in every month of Q3MediumGROUP BYZoomInfoPayPal
- Raw materials needed to build one finished productHardRecursive CTEsWalmartTargetAmazon
- Longest daily login streak per userHardWindow FunctionsSwiggyMeesho
- Sessionise a clickstream with a 30-minute ruleHardCTEsAmazonZoomInfo
- Checkout funnel with ordered stepsHardCTEsRazorpayFlipkart
- Double-booked meeting roomsHardJoins — Self JoinOracleOla
Want interview-ready depth?
Our live cohorts cover SQL from filters to window functions, then take you through dashboards, agentic analytics workflows and mock interviews with mentor feedback.