BigQuery lets a single cell hold many values, because a column can be an array, a struct, or an array of structs, and UNNEST is what turns those nested structures back into ordinary rows you can query. This cheatsheet gathers the whole toolkit on one page, from the comma join through struct dot notation, LEFT JOIN UNNEST, WITH OFFSET, multi-level chains, and ARRAY_AGG re-nesting, each snippet annotated line by line. Keep it open while you write SQL, or save the image and pin it nearby.
For the full background, read the guide to flattening nested data in BigQuery with UNNEST. To practise, work through the 10 code-along examples.
Download the cheatsheet
See you soon.
[…] Flattening Nested Data with UNNEST Cheatsheet […]