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.
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.