SQL Subqueries

Created by Abhyuday DesaiPublished , v1Runs 8 min 27 sec
0 views

About this video

The four subquery forms interviewers expect you to tell apart, and when each is the right tool. Three customers and three orders, one of them with no orders at all, power every example.

You'll review how to:

  • Use a scalar subquery as a single value in WHERE or the SELECT list, and what happens when it returns none or many rows
  • Test membership with IN and existence with EXISTS and NOT EXISTS, and why NOT IN breaks on NULL
  • Read a correlated subquery one outer row at a time
  • Choose between a subquery, a JOIN and a CTE for a presence or absence question

For engineers who know SELECT, WHERE, GROUP BY and basic joins. Presence and absence questions, and the anti-join.

What changed

  1. v103 Oct 2026abhydesai8 min 27 sec037acd5

    First published version.

    0 views0 likes on this version