Question: Following code is generating an error message I can not resolve. Please help. The error message is posted above the code. Error Code: 1215. Cannot

Following code is generating an error message I can not resolve. Please help. The error message is posted above the code.

Error Code: 1215. Cannot add foreign key constraint 0.375 sec

CREATE TABLE QUALIFIED

(FacultyID INT, CourseID VARCHAR(8) ,

DateQualified DATE,

CONSTRAINT QUALIFIED_PK PRIMARY KEY (FacultyID, CourseID),

CONSTRAINT QUALIFIED_FK FOREIGN KEY (FacultyID) REFERENCES FACULTY(FacultyID),

CONSTRAINT QUALIFIED_FK FOREIGN KEY (CourseID) REFERENCES COURSE(CourseID));

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The error message Error Code 1215 Cannot add foreign key constraint is due to issue with defining fo... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!