Posted by ZeldorBlat on 10/31/05 01:57
Presumably you have something like this:
create table hotel (
hotel_id int not null
....
)
create table room (
room_id int not null
hotel_id int not null
....
)
Then create a table to store the bookings. Something like this:
create table booking (
room_id int not null,
bookingDate smalldatetime
)
The primary key for this table should be (room_id, bookingDate). If
there is a row for a given room and date, then it's booked on that
date. Otherwise it isn't.
Navigation:
[Reply to this message]
|