I have a table which is part of a database for a specialist self-catering apartments booking system. The apartments have a fairly flexible occupancy criteria for adults and children and a correspondingly fairly complex pricing system. That is all do-able _ I think! The advice I need is on the structure of the table.
The table is called BookingDetails which currently is structured as follows.
PK BookingDetailsID
PK BookingID links to main Bookings table
PK FK RoomID links to Rooms table
?? GuestID links to Guests table holding guest names & addresses
.. NumAdults the number of adults to accomodated in that apartment
.. NumChildren the number of children to be accomodated
The GuestID should ideally be included as a 4th component for a PKey. However the booking enquiry will usually be of the form "I would like to accomodate the following adults/children... and the owner will then suggest the most suitable apartment(s). Otherwise the enquiry/booking is for a particular number of adults and children in a selection of apartments.
In other words the guests for a room are not defined at initial inquiry or booking and are filled in later. Consequently the GuestID's are initially necessarily NULL so can't be a PKey.
I am aware that the Numbers of Adults and Children will be repeated data and should probably be held seperately in another table but probably not essential to do so.
What is the best way to handle the GuestID field? I thought maybe initialise each booking details with a 'dummy guest' record. A bit messy to make sure that this isn't overwritten later when filling in the real data.
Any suggestions on how to deal efficiently and neatly with the fact that there must be a guest in each room eventually if not initially gratefully received.
The client who is booking/enquiring may not actually ultimately be a guest as they may be booking on behalf of others. They are simply the person to be billed, who may not or may not be present in one of the rooms and certainly not in all those booked!
Thanks.
John B
The table is called BookingDetails which currently is structured as follows.
PK BookingDetailsID
PK BookingID links to main Bookings table
PK FK RoomID links to Rooms table
?? GuestID links to Guests table holding guest names & addresses
.. NumAdults the number of adults to accomodated in that apartment
.. NumChildren the number of children to be accomodated
The GuestID should ideally be included as a 4th component for a PKey. However the booking enquiry will usually be of the form "I would like to accomodate the following adults/children... and the owner will then suggest the most suitable apartment(s). Otherwise the enquiry/booking is for a particular number of adults and children in a selection of apartments.
In other words the guests for a room are not defined at initial inquiry or booking and are filled in later. Consequently the GuestID's are initially necessarily NULL so can't be a PKey.
I am aware that the Numbers of Adults and Children will be repeated data and should probably be held seperately in another table but probably not essential to do so.
What is the best way to handle the GuestID field? I thought maybe initialise each booking details with a 'dummy guest' record. A bit messy to make sure that this isn't overwritten later when filling in the real data.
Any suggestions on how to deal efficiently and neatly with the fact that there must be a guest in each room eventually if not initially gratefully received.
The client who is booking/enquiring may not actually ultimately be a guest as they may be booking on behalf of others. They are simply the person to be billed, who may not or may not be present in one of the rooms and certainly not in all those booked!
Thanks.
John B