Your question is User Step-By-Step Navigation Query. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Discover's data science team wants to analyze how users progress through the Discover Mobile App. Write a PostgreSQL query that lists each user's app interactions in chronological order and labels them as step1, step2, and so on.
Discover Mobile App surface.event_name is missing.interaction_id as a tie-breaker, and return the results in user and event order.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Discover customer identifier |
| full_name | VARCHAR(100) | Customer display name |
| customer_segment | VARCHAR(30) | Customer segmentation label |
| Column | Type | Description |
|---|---|---|
| interaction_idPK | INT | Unique interaction identifier |
| user_id | INT | Customer associated with the interaction |
| product_surface | VARCHAR(50) | Discover product or channel where the event occurred |
| event_name | VARCHAR(60) | Interaction event name |
| occurred_at | TIMESTAMP | Time when the interaction occurred |
| device_type | VARCHAR(20) | Device used for the interaction |