Preventing Double Booking for a Hotel Room

commint

New member
Local time
Today, 14:13
Joined
Oct 19, 2015
Messages
3
Hi, I'm currently building a database for a hotel as part of my Uni course.

I've managed to get a simple database going but I can't work out how to get the room availability to change when a new booking is made, so that the room becomes unavailable to re-book on the dates its booked for.

The room availability is on the rooms table and is currently a check box. The dates for the bookings are 2009 because that is the data that the lecturer has given us.

I'll attach a zip of my database to this post and any help will be much appreciated.

Thanks in advance!

View attachment lborohotel.Zip
 
For a sample database re room availability see this link
 
I don't think availability can be a attribute of room as it depends on time. If you just want to know what rooms are not booked at all then the follow unmatched query would answer give you those rooms:

SELECT Rooms.RoomNumber
FROM Rooms LEFT JOIN Booking ON Rooms.RoomNumber = Booking.Room
WHERE (((Booking.Room) Is Null));
 
Last edited:

Users who are viewing this thread

Back
Top Bottom