The question bank
SQL Questions
55questions themed around companies you'll actually interview at in the region. Solve them right here: real Postgres, in your browser.
easyApplicants with no referral code on fileGXBank · basicsFree→easyAverage balance by account typeGXBank · aggregationFree→easyCheapest flights to a destinationAirAsia · basicsFree→easyClassify e-wallet balances into tiersBoost · basicsFree→easyClassify insurance policies into tiersAIA · basicsFree→easyClean up messy product namesZalora · textFree→easyCompleted rides by cityGrab · aggregationFree→easyDays remaining until subscription expiryAstro · date-timeFree→easyFind products from a specific brandLazada · textFree→easyFind Toyota listings, regardless of caseCarsome · textFree→easyLabel moderation queue items by urgencyTikTok · basicsFree→easyLine totals after a percentage discountTraveloka · mathFree→easyOrders by statusShopee · aggregationFree→easyProfit margin per productPanasonic · mathFree→easySelected routes, mid-range priceAirAsia · basicsFree→easyShipped or delivered orders worth over RM 100Zalora · basicsFree→easyShow 'Unassigned' for branches without a managerRHB Bank · basicsFree→easyWallets with a healthy balanceTouch 'n Go · basicsFree→mediumAd click-through conversion rate, per campaignGrab · aggregationPro→mediumAverage ride duration, by monthGrab · date-timePro→mediumBranches beating the network's average growthStandard Chartered · subqueryPro→mediumBuyers active in both January and FebruaryCarousell · basicsPro→mediumCustomers who never orderedShopee · joinsPro→mediumCustomers with no way to reach themPublic Bank · basicsPro→mediumDefect rate per production lineIntel · aggregationPro→mediumDrivers rated above averageGrab · subqueryPro→mediumEmployees who out-earn their managerCIMB · joinsFree→mediumEvery customer who has banked online or in a branchDBS Bank · basicsFree→mediumEvery part, with its supplier (if assigned)Toyota · joinsPro→mediumFlag shipments that breached their SLADHL · date-timePro→mediumInactive subscribersCelcomDigi · subqueryPro→mediumLabel TNB bills as on-time, late, or unpaidTenaga Nasional · basicsPro→mediumMonthly fuel salesPetronas · date-timePro→mediumOutage duration in minutesHuawei · date-timePro→mediumPivot quarterly sales into columnsGoTo · aggregationPro→mediumPlayers who churned after JanuaryTencent · basicsPro→mediumRevenue per routeAirAsia · joinsPro→mediumRound fares up, round loyalty points downGoCar · mathPro→mediumTop 3 restaurants by ordersFoodpanda · aggregationPro→mediumTotal fuel spend per monthSetel · date-timePro→mediumTotal spend per customerMaybank · joinsPro→hardBusiest data center in each regionAlibaba · windowPro→hardDay-over-day change in order volumeGrabFood · windowPro→hardDrivers delayed 3+ days in a rowNinja Van · windowPro→hardMonth-over-month change in units soldSony · windowPro→hardPair every employee with their managerPos Malaysia · joinsPro→hardPivot payment channels into columns, per merchantGCash · aggregationPro→hardPrevious month's revenueGrab · windowPro→hardRank customers by spendMaybank · windowPro→hardRank customers by transaction amount, per branchHSBC · windowPro→hardRunning total of daily salesShopee · windowPro→hardSecond most expensive product per categoryLazada · windowPro→hardSplit customers into spending quartilesShopee · windowPro→hardTotal paid, joined across three tablesViu · joinsPro→hardTotal shipped, joined across three tablesWestern Digital · joinsPro→