Database design of Room Booking system in a Hotel
Without knowing exact and whole requirements we cannot design a complete data model. Let us assume the following business rules, it is based on your question.
- Each Customer can request for one or more Room.
- Each Room can be requested by one Customer
- Each Admin can assign one or many Room.
- Each Room must be assigned by one Admin.
- Each Room must be belongs to one Room Type.
- Each Room Type can contain one or many Room.
- Each Booking must be belongs to one Date.
- Each Date can contain one or more Booking.
- Each Room Type can contain one or many Rent.
- Each Rent must belongs to one Room Type.
- Each Booking must include one or many Room.
- Each Room can be included in one Booking.
- Each Customer can hold one or many Booking.
- Each Booking must belongs to one Customer.
- Each Rent can be included in one or many Bill.
- Each Bill must include one Rent.
- Each Bill Payment must include one Payment Type.
- Each Payment Type can contain one or many Bill Payment.
- Each Date can contain one or many Bill Payment.
- Each Bill Payment must belongs to one Date.
- Each Room can be rated one or many Room Rating.
- Each Room Rating must belongs to one Room.
- Each Rating can contain one or many Room Rating.
- Each Room Rating must belongs to one Rating.
Based on the above rules we have designed the following data model.
This model is a subset of Hotel Booking system. After the normalization process (check here), you will have more detailed and complete model.
In the above model Room rent is calculated based on the room type such as Single Room, Doubles Room, Family Room or Meeting Hall rather than number of people in the room.
And Room rent is changed from time to time, so we have included the from date and to date to have history of room rents. Also customer can use many payment types such as credit card, debit card, cash payment, so we are included payment type entity.
This model is based on assumption. I hope this model will help you in someway.
Thank you.