Your question is SQL for Funnel Segments. 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.
Write a query to identify top-performing user segments based on multi-step conversion funnels.
Calculate performance for the funnel viewed_offer → started_application → completed_application. A user counts as started only when the start occurs after the view, and counts as completed only when completion occurs after the start. Include every segment, including segments with no qualifying starters.
segment, started_users, completed_users, conversion_rate, and performance_rank.conversion_rate is the completed-user percentage among qualifying starters, with zero for segments without starters.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| segment | VARCHAR(50) | User segment label |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| user_id | INT | User associated with the event |
| event_name | VARCHAR(40) | Funnel event type |
| event_at | TIMESTAMP | Timestamp when the event occurred |