best method. dates

best method. dates

am 30.10.2005 23:26:46 von not_on

Post removed (X-No-Archive: yes)

Re: best method. dates

am 31.10.2005 00:57:28 von zeldorblat

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.