This is my code, but when I try to create my "Qualified" Table it won't let me enter foreign keys and I don't know why.
CREATE TABLE STUDENT(StudentID integer,
StudentName char(25) NOT NULL,
primary key(StudentName))
CREATE TABLE FACULTY(FacultyID integer,
FacultyName char(25) NOT NULL,
primary key(FacultyID))
CREATE TABLE COURSE(CourseID integer,
CourseName char(15) NOT NULL,
primary key(CourseID))
CREATE TABLE QUALIFIED(DateQualified date,
foreign key(FacultyID) references FACULTY(FacultyID),
foreign key(CourseID) references COURSE(CourseID))
Columns in QUALIFIED table are missing in your CREATE TABLE Statement.
Update QUALIFIED table creation as follows:
CREATE TABLE QUALIFIED(DateQualified date,
FacultyID integer,
CourseID integer,
foreign key(FacultyID) references
FACULTY(FacultyID),
foreign key(CourseID) references
COURSE(CourseID))
First we need to create columns in the current table and
then foreign key relationship should be established with
corresponding tables.
Get Answers For Free
Most questions answered within 1 hours.