Question: Question 1 Not yet answered Create the booking table with five attributes: hid, cid, dstart, ndays, room. Choose an appropriate data type for each attribute



Question 1 Not yet answered Create the booking table with five attributes: hid, cid, dstart, ndays, room. Choose an appropriate data type for each attribute and specify that Marked out of 1.50 Flag question the primary key is a composite key consisting of three attributes: (hid, cid, dstart); the attribute cid is the foreign key referencing the primary key of the customer table. the attributes hid and room are the foreign keys referencing the primary key (hid, num) of the room table. the composite key (hid, room, dstart) is an alternate key to prevent any double bookings for a hotel room. Note, for the correct answer, you'll need to consult the worksheet. CREATE TABLE booking ( hid cid dstart DATE FOLIO Clu dstart DATE, ndays INTEGER, room (hid, cid, dstart), (hid, room, dstart), FOREIGN KEY ) REFERENCES room ], FOREIGN KEY ) REFERENCES CHAR(1) CHAR(4) VARCHAR(225) CHAR(5) INTEGER SMALLINT BIGINT NOT NULL UNIQUE NULL NOT NULL PRIMARY KEY CHECK UNIQUE hid num hid room customer cid cid
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
