Question: 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

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.

CREATE TABLE Employees

(

EmployeeID NUMBER NOT NULL,

LastName VARCHAR2(20) NOT NULL,

FirstName VARCHAR2(10) NOT NULL,

Title VARCHAR2(30),

TitleOfCourtesy VARCHAR2(25),

BirthDate DATE,

HireDate DATE,

Address VARCHAR2(60),

City VARCHAR2(15),

Region VARCHAR2(15),

PostalCode VARCHAR2(10),

Country VARCHAR2(15),

HomePhone VARCHAR2(24),

ReportsTo NUMBER,

CONSTRAINT PK_Employees

PRIMARY KEY (EmployeeID),

CONSTRAINT FK_Employees_Employees FOREIGN KEY (ReportsTo) REFERENCES Employees(EmployeeID)

)

/

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!