Answered step by step
Verified Expert Solution
Link Copied!

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));

image text in transcribed

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 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

Discuss the performance appraisal process.

Answered: 1 week ago