Lyft city operations wants to identify the highest-spending riders in each market. Write a PostgreSQL query using Lyft ride data to return the top five riders by completed-trip spending during the past quarter, represented here as 2025-04-01 through 2025-06-30.
| Column | Type | Description |
|---|---|---|
| city_idPK | INT | Unique city identifier |
| city_name | VARCHAR(100) | Lyft market name |
| Column | Type | Description |
|---|---|---|
| rider_idPK | INT | Unique rider identifier |
| rider_name | VARCHAR(100) | Rider's display name |
| city_id | INT | Rider's associated city |
| Column | Type | Description |
|---|---|---|
| ride_idPK | INT | Unique ride identifier |
| rider_id | INT | Rider who requested the ride |
| fare_amount | DECIMAL(10,2) | Fare charged for the ride |
| requested_at | TIMESTAMP | Ride request timestamp |
| status | VARCHAR(20) | Ride lifecycle status |