At Lyft, an Operations Manager may use a pivot-style summary to see where a market is breaking down across the ride funnel. Write a SQL query to summarize funnel volume by market and pivot funnel_stage into separate columns.
market for records on event_date = '2024-06-01'.sessions, ride_requests, matched_rides, and completed_rides using conditional aggregation.completed_rides ascending, then market ascending.| Column | Type | Description |
|---|---|---|
| idPK | INT | Primary key for each funnel record |
| market | VARCHAR(50) | Lyft market name |
| event_date | DATE | Date of the funnel measurement |
| funnel_stage | VARCHAR(30) | Funnel step being measured |
| stage_count | INT | Count recorded for that stage |
| note | VARCHAR(100) | Optional annotation from operations |