A subquery is a query nested inside another, placed wherever a value or a table is expected. This cheatsheet gathers every place one can go, plus the operators and the CTEs that usually replace deep nesting, each snippet annotated line by line. Keep it open while you query, or save the image and pin it nearby.
For the full background, read the guide to subqueries and nested queries in BigQuery. To practise, work through the 10 code-along examples.
[…] BigQuery Subqueries and Nested Queries Cheatsheet […]