Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Every time I try to run this in MySQL I keep getting a syntax error. Can someone Please Help CREATE TABLE PREREQUISITE ( CourseNumber CHAR(8)
Every time I try to run this in MySQL I keep getting a syntax error. Can someone Please Help
CREATE TABLE PREREQUISITE ( CourseNumber CHAR(8) NOT NULL, PrerequisiteNumber CHAR(8) NOT NULL, PRIMARY KEY (CourseNumber, PrerequisiteNumber), FOREIGN KEY (PrerequisiteNumber) REFERENCES COURSE(CourseNumber), FOREIGN KEY (PrerequisiteNumber) REFERENCES COURSE(CourseNumber));
CREATE TABLE COURSE ( CourseName VARCHAR(30) NOT NULL, CourseNumber CHAR(8) NOT NULL, CreditHours INTEGER, Department CHAR(4), PRIMARY KEY (CourseName));
mysql> CREATE TABLE PREREQUISITE (CourseNumber CHAR(8) NOT NULL, PrerequisiteNumber CHAR(8) NOT NULL, PRIMARY KEY (CourseNumber, PrerequisiteNumber), FOREIGN KEY(PrerequisiteNumber) REFERENCES COURSE (Cour seNumber)); ERROR 1824 (HY000): Failed to open the referenced table 'COURSE mysql> CREATE TABLE COURSE (CourseName VARCHAR(30) NOT NULL, CourseNumber CHAR(8) NOT NULL, CreditHours INTEGER, Department CHAR(4) PRIMARY KEY (CourseName)); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(CourseName))' at line 1 mysql> CREATE TABLE COURSE (CourseName VARCHAR(30) NOT NULL, CourseNumber CHAR(8) NOT NULL, CreditHours INTEGER, Department CHAR(4) PRIMARY KEY (CourseNumber)); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(CourseNumber))' at line 1 mysql> CREATE TABLE COURSE (CourseName VARCHAR(30) NOT NULL, CourseNumber CHAR(8) NOT NULL, CreditHours INTEGER, Department CHAR(4) PRIMARY KEY (CourseName)); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(CourseName))' at line 1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started