TASK #181 · Medium · Booking.comCancellation Rate per City
Your brief
For every city, compute the share of bookings that were cancelled
(status = 'cancelled').
Write a query that returns city, total_bookings (total bookings), cancelled_bookings (cancelled of them) and cancellation_rate (the cancellation percentage rounded to two decimals:
Write a query that returns city, total_bookings (total bookings), cancelled_bookings (cancelled of them) and cancellation_rate (the cancellation percentage rounded to two decimals:
cancelled / total × 100).
Ctrl / ⌘ + ↵
Result
Write a query and run it to see the results.
Schema
propertiesproperty_id, name, city, country, property_type, starsbookingsbooking_id, property_id, user_id, check_in, check_out, total_price, status