RienSQL
TASK #181 · Medium · Booking.com

Cancellation 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: cancelled / total × 100).
Expected columnscity total_bookings cancelled_bookings cancellation_rateBooking.com
SQL editor
SQLite
Ctrl / ⌘ + ↵
Result

Write a query and run it to see the results.

Schema
propertiesproperty_id, name, city, country, property_type, stars
bookingsbooking_id, property_id, user_id, check_in, check_out, total_price, status