I am having trouble creating a third table in my MYSQL program
I am having trouble creating a third table in my MYSQL program. i have to create Three data tables Faculty, Courses and FacultyCourses. The third table (Faculty Courses) always shows an error message
my code is shown below
CREATE TABLE Faculty (
FacultyID INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50) NOT NULL,
Email VARCHAR(255) NOT NULL,
Date_of_Birth date NOT NULL,
Date_of_Hire date NOT NULL
);
CREATE TABLE Courses (
CourseID INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
Discipline VARCHAR(50) NOT NULL,
Course_Number INT(11) NOT NULL,
Date_First_Offered INT(11) NOT NULL,
Number_of_Credits INT(11) NOT NULL,
Course_Title VARCHAR(50) NOT NULL
);
And for my Third table:
CREATE TABLE FacultyCourses (
FacultyCoursesID INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
FacultyID INT(6) NOT NULL,
CourseID INT(6) NOT NULL,
FOREIGN KEY (FacultyID) REFERENCES Faculty(FacultyID)ON DELETE CASCADE,
FOREIGN KEY (CourseID) REFERENCES Courses(CourseID)ON DELETE CASCADE
);
My goal is to design the third table based on the Faculty and Courses table using the primary and foreign key relationships.
i have attached a screenshot. i am using a windows MySQL database
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
