Extract `target` from each click's payload
In events the payload is stored as JSONB and may contain any set of keys. For events of type click the payload has a target key — the name of the button the user pressed.
Analytics wants a list of every click along with its target. For each event of type click extract the target value from payload (as a string) and return the event id together with that value. Sort by id.
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.
| id | target |
|---|---|
| 3 | buy |
| 10 | buy |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in