question

arooshakahoot avatar image
arooshakahoot asked

Hotel Reservation software using Microsoft SQL SERVER?

I am using microsoft sql server management studio. creating a database hotel reservation system. I have three entities customer,reservation and room. Room includes room_id,room_type,room price,room status Reservation includes cust_id,room_id,checkindate,checkoutdate,charges. I am having difficulty on how to show a room has been reserved.How to update status in the room table to occupied or not occupied. Also how to create a procedure to calculate charges? I am new to this whole sql thing.
sql server 2012mssql
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Kev Riley avatar image
Kev Riley answered
You wouldn't change anything in the room table to show the status of a room as this table should just represent the entity - the status is dependant on dates - meaning that a room that is occupied this week, might not be next week. You already have a reservation table - that should be enough for you to work out the status of a room on any given date. Join this to the room table (with an outer join) and you have a complete picture of all rooms on a given date.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.