Your question is Compare Driver Hourly Earnings by Zone. Start with the requirements and the one table 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.
RideNow wants a simple comparison of driver pay efficiency across service areas. Write a SQL query to calculate the average earnings per hour for rides in the Downtown zone versus the Suburbs zone.
zone is Downtown or Suburbs.SUM(earnings) / SUM(ride_minutes / 60.0).ride_minutes is NULL or less than or equal to 0.zone and avg_earnings_per_hour, ordered by avg_earnings_per_hour descending.| Column | Type | Description |
|---|---|---|
| ride_idPK | INT | Unique ride identifier |
| driver_id | INT | Driver identifier |
| zone | VARCHAR(50) | Service zone where the ride occurred |
| ride_minutes | INT | Ride duration in minutes |
| earnings | DECIMAL(10,2) | Driver earnings for the ride |
| ride_date | DATE | Date of the ride |