A list column holds many values per row; UNNEST turns them back
into rows:
SQL
SELECT order_id, UNNEST(items) AS item
FROM orders_json;
Each order row fans out to one row per item — after that, plain SQL
applies (GROUP BY, joins, window functions).
The pattern for API payloads: land the raw JSON, UNNEST to your
chosen grain, and only then build models on top. Untangling shape and
logic in the same query is where nested-data SQL gets unreadable.