Skip to content
SQLSimplified
Data EngineerQuestion 52 of 55

Unnesting Arrays

Problem

You received JSON data where a user's purchased items are stored in a single array column [item1, item2]. You need to flatten this out into standard relational rows for a JOIN. Write a query that outputs function with the value: "UNNEST() is used to expand an array into a set of rows."

Database Schema

This problem acts as a scratchpad. You will write your own DDL/DML or conceptual queries, so there is no predefined schema.

Try It

Loading playground environment...

Hint

Solution