Top driver in each city
A ride-hailing service rewards the best driver in each city. For each city, find the driver with the highest total fare across completed trips. Ignore trips with no assigned driver. Return city, driver_id and the revenue total, ordered by city, then driver id.
Eksempel på forventet output
Sådan ser et korrekt svar ud — dets rækketal er dets eget og behøver ikke at matche skematabellerne.
| city | total | driver_id |
|---|---|---|
| Kazan | 400 | 3 |
| Moscow | 800 | 1 |
Log ind for at se indsendelseshistorik
Log indLog ind for at bruge AI-mentor
Log ind