Question: CREATE TABLE Orders ( OrderID NUMBER NOT NULL, CustomerID CHAR(5), EmployeeID NUMBER, OrderDate DATE, RequiredDate DATE, ShippedDate DATE, Freight NUMBER, ShipName VARCHAR2(40), ShipAddress VARCHAR2(60), ShipCity

CREATE TABLE Orders

(

OrderID NUMBER NOT NULL,

CustomerID CHAR(5),

EmployeeID NUMBER,

OrderDate DATE,

RequiredDate DATE,

ShippedDate DATE,

Freight NUMBER,

ShipName VARCHAR2(40),

ShipAddress VARCHAR2(60),

ShipCity VARCHAR2(15),

ShipRegion VARCHAR2(15),

ShipPostalCode VARCHAR2(10),

ShipCountry VARCHAR2(15),

CONSTRAINT PK_Orders

PRIMARY KEY (OrderID),

CONSTRAINT FK_Orders_Customers FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID),

CONSTRAINT FK_Orders_Employees FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID)

)

/ I have provided SQL code to create all tables and insert all data. There is an error in setting referential integrity: one of the tables is missing references. Read the code and identify the problem. You can either modify create table statement or add alter table statement to include missing references.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!