Topic
Subqueries and CTEs
Building a query in stages, with CTEs and correlated subqueries. These questions are less about syntax than about decomposition — most become straightforward once the intermediate result is named.
New to this? Read the Subqueries & CTEs chapter.
mediumAccounts above their own branch's averageHSBC · subqueryBasic→mediumBranches beating the network's average growthStandard Chartered · subqueryBasic→mediumDrivers rated above averageGrab · subqueryBasic→mediumFind accounts with zero transactionsHong Leong Bank · subqueryFree→mediumInactive subscribersCelcomDigi · subqueryBasic→mediumPick the largest transactions for audit samplingPwC · subqueryFree→hardFind duplicate fraud alerts on the same cardAmBank · subqueryBasic→