Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you correct the syntax on my database so it works ondbfiddle with mySQL CREATE TABLE Supplier ( SupplierID int PRIMARY KEY, DeliveryDate date, DeliveryID

Can you correct the syntax on my database so it works ondbfiddle with mySQL

CREATE TABLE Supplier
(
SupplierID int PRIMARY KEY,
DeliveryDate date,
DeliveryID int,
FOREIGN KEY (DeliveryID) REFERENCES Delivery(DeliveryID),
FOREIGN KEY (DeliveryDate) REFERENCES Delivery(DeliveryDate)
);


CREATE TABLE Order
(
OrderID int PRIMARY KEY,
OrderDate date,
HeadquartersID int,
HeadquartersID int FOREIGN KEY REFERENCESHeadquarters(HeadquartersID)
);


CREATE TABLE OrderDetail
(
OrderDetailID int PRIMARY KEY,
(ProductID) FOREIGN KEY REFERENCES Product(ProductID),
(OrderID) FOREIGN KEY REFERENCES orderr(OrderID),
OrderID int,
ProductID int,
ProductQuantity int
);


CREATE TABLE Product
(
ProductID int PRIMARY KEY,
SupplierID int,
FOREIGN KEY (SupplierID) REFERENCES Supplier(SupplierID)
);


CREATE TABLE OrderDeliveryDetail
(
DeliveryID int,
FOREIGN KEY (DeliveryID) REFERENCES Delivery(DeliveryID),
OrderID int FOREIGN KEY REFERENCES Order(OrderID),
OrderDetail varchar(50)
);


CREATE TABLE Headquaters
(
HeadquatersID int,
BranchID int,
FOREIGN KEY (BranchID)REFERENCES Branch(BranchID)
);


CREATE TABLE Branch
(
BranchID int PRIMARY KEY
);

CREATE TABLE Delivery
(
DeliveryID int PRIMARY KEY,
DeliveryDate date,
SupplierID int FOREIGN KEY REFERENCES Supplier(SupplierID)
);

image text in transcribed

Schema Error: Error: ER_CANNOT_ADD_FOREIGN: Cannot add foreign key constraint Schema Error: Error: ER_PARSE_ERROR: 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 'Order (OrderID int PRIMARY KEY, OrderDate date, HeadquartersID int, Headquarter' at line 1 Schema Error: Error: ER_PARSE_ERROR: 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 '(ProductID) FOREIGN KEY REFERENCES Product(ProductID), (OrderID) FOREIGN KEY REF' at line 3 Schema Error: Error: ER_CANNOT_ADD_FOREIGN: Cannot add foreign key constraint Schema Error: Error: ER_PARSE_ERROR: 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 'FOREIGN KEY REFERENCES Order(OrderID), OrderDetail varchar(50) )' at line 4 United Kingdom. Schema Error: Error: ER_CANNOT_ADD_FOREIGN: Cannot add foreign key constraint Terms of Use Privacy/Cookie Policy Status 200 Ltd 201 Schema Error: Error: ER_PARSE_ERROR: 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 'FOREIGN KEY REFERENCES Supplier(SupplierID) )' at line 4

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_2

Step: 3

blur-text-image_3

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

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

More Books

Students also viewed these Programming questions

Question

Create a Fishbone diagram with the problem being coal "mine safety

Answered: 1 week ago