One Row per Item
One Row per Item
L. wants to analyze products individually, but each basket is stored as an array in the event log. From events, return event_id and item, with one row for every element of items; omit events that contain no items. Sort by event_id, then by item.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables. Your answer must use the same column names as this sample — alias them with AS if needed.
| event_id | item |
|---|---|
| 2 | dry food |
| 3 | cat bed |
| 3 | dry food |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inFocus radio
Paused · SomaFM · Fluid