-2

//DON'T KNOW THE REASON FOR GETTING ERROR FOR THE CHECKINGDATE AS I HAVE REFERENCED IT IN THE NEXT TABLE. CREATE TABLE CHECKIN( BOOKINGID NUMBER , CHECKINDATE DATE, SERVICENO NUMBER, PRIMARY KEY (BOOKINGID), FOREIGN KEY (BOOKINGID) REFERENCES RESERVATION, FOREIGN KEY (SERVICENO) REFERENCES SERVICE );

CREATE TABLE CHECKOUT( BOOKINGID NUMBER, CHECKINDATE DATE, CHECKOUTDATE DATE, SERVICENO NUMBER, PRIMARY KEY ( BOOKINGID), FOREIGN KEY (BOOKINGID) REFERENCES CHECKIN , FOREIGN KEY (CHECKINDATE) REFERENCES CHECKIN, FOREIGN KEY (SERVICENO) REFERENCES CHECKIN );

1
  • 1. Welcome to DBA.SE 2. Please include definitions for all tables referenced (I'm not seeing anything for SERVICE. 3. You can only define FK constraints on keys. 4. You don't need to store/reference the CHECKINDATE and SERVICENO with the checkout information, it already exists in CHECKIN
    – bbaird
    Oct 29 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.