Skip to content
>_sqlbuddy

Interview preparation

SQL Subquery Interview Questions

Subquery patterns interviewers actually ask: second highest, above average, NOT IN vs NOT EXISTS, and derived tables — with practice questions.

The subquery patterns that recur

Scalar subqueries in WHERE for 'second highest' and 'above average'; IN with a derived set for 'customers who did X'; derived tables in FROM for pre-aggregation.

The NULL trap in NOT IN is a favorite interview follow-up: what happens when the subquery returns NULL? The answer — nothing matches — is worth knowing cold.

Practice questions

Topics

Keep learning