easyGrab · aggregation
Completed rides by city
Grab's operations team wants to know how many completed rides happened in each city.
From the rides table, return the city and the number of completed rides (status = 'completed') as completed_rides, for every city that has at least one completed ride.
Schema
▸rides
| id | INT |
| city | TEXT |
| status | TEXT |
| fare | NUMERIC(8,2) |
Example input
▸rides