BUILDS ON
TOPICS
#17
Subqueries in Filters
Substitute a subquery's result into a WHERE clause, as a single value for = or a column for IN, predict why one NULL makes NOT IN return zero rows, and rewrite the test as a join when that reads cleaner.
13 min
#18
EXISTS & Correlated Subqueries
Wrap a correlated subquery in EXISTS to test existence row by row, explain why NOT EXISTS stays NULL-safe where a stray NULL empties NOT IN, and read the plan to see that IN and EXISTS run the same way on a large table.
14 min
#19
CTEs & Recursive CTEs
Flatten a nested subquery into a named WITH pipeline that reads top to bottom, then walk an org chart with a recursive CTE, pairing a base case with a step that re-runs over the working table until it empties.
15 min