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.
Przykładowy oczekiwany wynik
Tak wygląda poprawna odpowiedź — liczba jej wierszy jest swoista i nie musi odpowiadać tabelom ze schematu.
| city | total | driver_id |
|---|---|---|
| Kazan | 400 | 3 |
| Moscow | 800 | 1 |
Zaloguj się, aby zobaczyć historię rozwiązań
Zaloguj sięZaloguj się, aby korzystać z Mentora AI
Zaloguj się