This repository contains the data warehouse schema design for a hotel booking system. The schema follows a star schema model, with fact tables and dimension tables that support efficient queries for booking, property operations, and revenue analysis.
-
fact_booking
This table contains detailed records of hotel bookings.- Columns:
booking_id
: Unique identifier for each booking.property_id
: Links to the hotel (property) where the booking was made.booking_date_id
: Links to the date the booking was created (indim_date
).check_in_date_id
: Links to the check-in date (indim_date
).checkout_date_id
: Links to the checkout date (indim_date
).booking_date
: The actual booking date.check_in_date
: The actual check-in date.checkout_date
: The actual checkout date.no_guests
: Number of guests in the booking.room_category
: The type of room booked.booking_platform
: The platform used for the booking (e.g., website, app).ratings_given
: Customer ratings for the booking.booking_status
: The status of the booking (e.g., confirmed, canceled).revenue_generated
: Total revenue generated from the booking.revenue_realized
: Revenue actually realized after discounts, cancellations, etc.
- Columns:
-
fact_properties_operations
This table tracks operational details related to the properties (hotels).- Columns:
property_id
: Links to the hotel (property) where operations are tracked.check_in_date_id
: Links to the check-in date (indim_date
).room_category
: The room category for operational tracking.successful_booking
: Indicator of whether the booking was successful.
- Columns:
-
dim_date
Provides time-related information, allowing for time-series analysis of bookings and operations.- Columns:
date_id
: Unique identifier for each date.yy_mm_dd
: The date in year-month-day format.week_num
: The week number of the year.day_type
: The type of day (e.g., weekend, weekday).
- Columns:
-
dim_rooms
Details about the rooms and their classifications.- Columns:
room_id
: Unique identifier for each room.room_class
: The classification of the room (e.g., standard, deluxe, suite).
- Columns:
-
dim_hotel
Contains metadata about the hotels (properties) where bookings and operations are tracked.- Columns:
property_id
: Unique identifier for each hotel.property_name
: The name of the hotel.category
: The category or classification of the hotel (e.g., 3-star, 5-star).city
: The city where the hotel is located.
- Columns:
-
fact_booking is linked to:
dim_date
viabooking_date_id
,check_in_date_id
, andcheckout_date_id
.dim_hotel
viaproperty_id
.dim_rooms
viaroom_category
.
-
fact_properties_operations is linked to:
dim_date
viacheck_in_date_id
.dim_hotel
viaproperty_id
.dim_rooms
viaroom_category
.
This data warehouse schema is designed to support various types of analysis in the hotel industry, including:
- Tracking booking patterns over time.
- Analyzing hotel property operations and performance.
- Evaluating room occupancy and revenue generation.
- Monitoring booking platforms and customer ratings.
By using a star schema, this model enables efficient querying and reporting for business intelligence purposes.