Menu▾

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.

easyProducts nobody has bought yetNewBasic→mediumAccounts above their own branch's averageBasic→mediumBranches beating the network's average growthBasic→mediumDrivers rated above averageBasic→mediumFind accounts with zero transactionsFree→mediumInactive subscribersBasic→mediumPick the largest transactions for audit samplingFree→hardFind duplicate fraud alerts on the same cardBasic→