DoorDash logistics team wants to identify high-performing couriers. A courier is considered high-performing if their average delivery speed is at least 20% faster than the average delivery speed of all couriers in the same city.
Write an SQL query to find these couriers.
| courier_id(INTEGER) | city_id(INTEGER) |
|---|---|
| 1 | 501 |
| 2 | 501 |
| 3 | 501 |
| 4 | 502 |
| 5 | 502 |
| 6 | 502 |
| delivery_id(INTEGER) | courier_id(INTEGER) | distance(DECIMAL) | duration(INTEGER) |
|---|---|---|---|
| 10 | 1 | 5 | 10 |
| 11 | 1 | 6 | 12 |
| 12 | 2 | 3 | 15 |
| 13 | 3 | 4 | 20 |
| 14 | 4 | 10 | 15 |
| 15 | 5 | 5 | 20 |
| 16 | 6 | 2 | 10 |
| courier_id(INTEGER) | city_id(INTEGER) | courier_avg_speed(DECIMAL) | city_avg_speed(DECIMAL) |
|---|---|---|---|
| 1 | 501 | 0.5 | 0.3 |
| 4 | 502 | 0.67 | 0.37 |