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.
Exemplo de resposta esperada
É assim que se parece uma resposta correta: ela tem seu próprio número de linhas e não precisa coincidir com as tabelas do esquema.
| city | total | driver_id |
|---|---|---|
| Kazan | 400 | 3 |
| Moscow | 800 | 1 |
Entre para ver seu histórico de envios
EntrarEntre para usar o AI Mentor
Entrar