Hotel Booking Insights
Why do hotel bookings get cancelled, and what does it cost? I ran end-to-end exploratory analysis on 119,390 bookings: I cleaned them with Pandas, modelled them in PostgreSQL, and answered five business questions with SQL to inform capacity planning and risk management.
A cancelled booking is an empty room that could have been sold. Hotel managers need to know which bookings are risky (by hotel type, season, channel, country and how far ahead they were made) so they can set deposit policies, plan capacity, overbook sensibly and spend marketing money on reliable channels. In other words, so they can manage cancellation risk instead of reacting to it.
hotel_bookings model, loaded by Python with credentials in env variableshere's query #1, the one behind the headline number ↓
SELECT hotel AS hotel_type,
SUM(is_canceled) AS cancellations,
COUNT(*) AS total_bookings,
ROUND(SUM(is_canceled) * 100.0 / COUNT(*), 2) AS cancellation_rate
FROM hotel_bookings
GROUP BY hotel
ORDER BY cancellation_rate DESC;
What the data said
Every chart below is drawn from my query output. The raw results are at the bottom of the page.
Cancellation rate by hotel type
City hotels lose 4 in 10 bookings.
33,102 of 79,330 city bookings vs. 11,122 of 40,060 resort bookings.
Cancellation rate by booking channel
Travel agents and tour operators are the riskiest channel.
TA/TO = travel agents & tour operators (97,870 bookings). "Undefined" (5 bookings) left out.
Bookings by arrival month
Summer peaks: August has 2.3× the bookings of January.
Cancellation rate by lead time
The further ahead people book, the more likely they cancel.
74-day buckets from width_bucket. Buckets past 591 days hold under 200 bookings and are left out.
Highest cancellation rates by country
Countries with more than 50 bookings.
Portugal is the one that matters: 48,590 bookings (41% of the dataset) at a 56.6% cancel rate.
So what?
City hotels need stricter policies
They cancel at 41.7% vs. 27.8% for resorts, and lose more than 5.8M in revenue to cancellations. Non-refundable rates or deposits would hit the biggest leak first.
Shift budget toward direct and corporate bookings
Direct (17.5%) and corporate (22.1%) bookings are far more reliable than travel agents (41.0%).
Treat early bookings as soft
Bookings made more than about six months out cancel more often than not, so they're safer to overbook or to back with a deposit.
Staff and price for July–August
Summer brings the most arrivals, which makes it the time for dynamic pricing and extra staff.
Raw query output
Straight from the terminal, so you can check the numbers above.




