Click to See Complete Forum and Search --> : data base task


john_zakaria
12-21-2008, 07:03 AM
room_type
rooms_no
persons
checkin
checkout

3 2 1 0000-00-00 0000-00-00
6 3 4 2008-11-14 0000-00-00
6 3 4 2008-11-14 0000-00-00
4 4 5 2008-11-14 2008-11-18

Now I have this table and I want to make SQL STATEMENT to make the following task

To see if the user can make a reservation in a hotel during the checkin and checkout date, by checking the numbers of rooms available in each room type during the checkin and checkout period of time
For example if the user enter number of persons that exceed the person that exists already in the database
And also to check if this period of time is available to make reservation according the the persons number


Note : rooms-type in this example are (3,6,6,4)
room_no in this example are (2,3,3,4)
person (1,4,4,5) -> number of persons