Write a query to identify the top 5% of drivers in each city based on their monthly completed trips and ratings on Uber Drivers. Use completed trips only, and use average driver ratings as the secondary ranking criterion. Break ties consistently by driver ID.
city, monthly_month, driver_id, completed_trips, and average_ratingcity, monthly_month, completed trips descending, average rating descending, and driver ID| Column | Type | Description |
|---|---|---|
| driver_idPK | INT | Unique Uber Drivers driver identifier |
| city | VARCHAR(100) | City where the driver operates |
| Column | Type | Description |
|---|---|---|
| trip_idPK | INT | Unique trip identifier |
| driver_id | INT | Driver who completed or attempted the trip |
| completed_at | TIMESTAMP | Trip completion timestamp |
| status | VARCHAR(20) | Trip lifecycle status |
| Column | Type | Description |
|---|---|---|
| rating_idPK | INT | Unique rating identifier |
| trip_id | INT | Trip receiving the rating |
| rating | DECIMAL(2,1) | Passenger rating from 1.0 to 5.0 |