Your question is Top Cities by Ride Growth. Start with the requirements and the three 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.
SwiftRide wants to identify which cities are growing fastest in completed rides month over month. Write a SQL query to return the top cities by ride growth rate for each month.
(current_month_rides - previous_month_rides) / previous_month_rides * 100.| Column | Type | Description |
|---|---|---|
| city_idPK | INT | Unique city identifier |
| city_name | VARCHAR(100) | City name |
| region | VARCHAR(50) | Operating region for the city |
| Column | Type | Description |
|---|---|---|
| driver_idPK | INT | Unique driver identifier |
| city_id | INT | Driver's assigned city |
| driver_name | VARCHAR(100) | Driver full name |
| status | VARCHAR(20) | Driver status such as active or inactive |
| Column | Type | Description |
|---|---|---|
| ride_idPK | INT | Unique ride identifier |
| driver_id | INT | Driver associated with the ride |
| rider_id | INT | Rider identifier |
| ride_date | DATE | Date the ride occurred |
| ride_status | VARCHAR(20) | Ride status such as completed or cancelled |
| fare_amount | NUMERIC(10,2) | Fare charged for the ride |