Vaibhav Goel
asked on
Help Required
Here is a table for recording guests' stays at a hotel (arrDate denotes arrival date, depDate is departure date):
CREATE TABLE HotelStays
(roomNum INTEGER NOT NULL,
arrDate DATE NOT NULL,
depDate DATE NOT NULL,
guestName CHAR(30) NOT NULL,
PRIMARY KEY (roomNum, arrDate));
A new entry (for a new guest) could be accidentally put in for a room number, even before the existing guest in that room has not checked out:
How would you redesign the table to fix this issue
CREATE TABLE HotelStays
(roomNum INTEGER NOT NULL,
arrDate DATE NOT NULL,
depDate DATE NOT NULL,
guestName CHAR(30) NOT NULL,
PRIMARY KEY (roomNum, arrDate));
A new entry (for a new guest) could be accidentally put in for a room number, even before the existing guest in that room has not checked out:
How would you redesign the table to fix this issue
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
Open in new window
Hope it helps!