TASK #214 · Medium · CabifyCancellation Rate by City
Your brief
Each row of the rides table is a Cabify ride request. Both statuses count
as a cancellation: cancelled_by_rider (cancelled by the rider) and
cancelled_by_driver (cancelled by the driver).
Write a query that for every city returns city, total_rides (the number of all ride requests) and cancellation_rate_pct (the percentage of cancelled ones among them, rounded to two decimals). Sort by cancellation_rate_pct descending and, on ties, by city alphabetically.
Write a query that for every city returns city, total_rides (the number of all ride requests) and cancellation_rate_pct (the percentage of cancelled ones among them, rounded to two decimals). Sort by cancellation_rate_pct descending and, on ties, by city alphabetically.
Ctrl / ⌘ + ↵
Result
Write a query and run it to see the results.
Schema
driversdriver_id, driver_name, city, car_modeldriver_shiftsshift_id, driver_id, shift_start, shift_endridesride_id, driver_id, city, requested_at, status, started_at, ended_at, distance_km, surge_multiplier, fare_eur