A relational database project developed using Microsoft SQL Server for managing hotel branches, managers, staff, rooms, customers, reservations, invoices, and customer requests.
- Stores hotel branch, manager, and staff information
- Manages room types, room rates, and room availability
- Stores customer details and reservations
- Supports bookings containing one or more rooms
- Records invoices, payments, ratings, and reviews
- Stores additional hotel services requested by customers
- Includes sample data for testing
- Includes analytical SQL queries for revenue, customer spending, reservations, and room ratings
The database contains the following tables:
BranchManagerStaffRoomAvailabilityCustomer_DetailsReservationBooked_RoomsInvoiceRequestCustomer_Request
Booked_Rooms connects reservations with rooms, while Customer_Request connects reservations with additional service requests.
- Database and table creation
- Primary keys and foreign keys
- Composite primary keys
INSERT,UPDATE, andSELECTINNER JOIN- Subqueries
- Aggregate functions such as
SUM,AVG, andCOUNT GROUP BY,HAVING, andORDER BY- Date filtering using
YEAR()andMONTH() - Many-to-many relationships
The SQL script includes queries that:
- Find customers who have not made reservations since the beginning of 2023
- Calculate monthly revenue for 2023
- Find customers with more than three reservations
- Calculate average ratings and review totals by room type
- Calculate total revenue generated by each branch
- Calculate the total amount spent by each customer
- Compare total and average spending by gender
- Display branch, manager, and room information
- Find the customer with the highest number of reservations
- Find customers who stayed at more than one branch
- Microsoft SQL Server
- SQL Server Management Studio (SSMS)
The script uses Microsoft SQL Server syntax, including NVARCHAR, TOP, YEAR(), and MONTH().
- Open SQL Server Management Studio.
- Connect to a SQL Server instance.
- Open the SQL script.
- Make sure the beginning of the script contains:
CREATE DATABASE X_Hotel_fin;
GO
USE X_Hotel_fin;
GO- Execute the script to create the tables and insert the sample data.
- Run the analytical queries at the bottom of the file individually to view their results.
hotel-booking-management-system/
├── hotel_booking_management.sql
├── project-report.docx
└── README.md
Recommended file renaming:
FinalXHotel(1).sql -> hotel_booking_management.sql
Database Assignment Part 2 final(1).docx -> project-report.docx
- Hein Htet
- Hemshika Shreeya Jadoo
- Mohammad Abu Nur Tasfi
- Stephie Li Ah Kane
This project was created as a group assignment for the Introduction to Database module at Asia Pacific University of Technology & Innovation.
The records included in the project are sample data created for educational and demonstration purposes.