Question: Q 2 . ( 3 5 points ) Consider the following relational schema DDL statements and tables. Show the status of each table after each
Q points Consider the following relational schema DDL statements and tables. Show the
status of each table after each of the following operations:
a Changing the employee whose to in the table EMPLOYEE. If it is rejected, explain.
EMPLOYEE EmployeeID, EmployeeName, SupervisorID, DepartmentID
PROJECT ProjectID EmployeeID
DEPARTMENT Department ID DepartmentName
CREATE TABLE EMPLOYEE
EmployeeID INT PRIMARY KEY,
EmployeeName VARCHAR NOT NULL,
SupervisorID INT DEFAULT
DepartmentID INT. DEFAULT
FOREIGN KEY SupervisorID REFERENCES EMPLOYEE EmployeeID
ON DELETE SET DEFAULT,
FOREIGN KEY DepartmentID REFERENCES DEPARTMENTDepartmentID
ON UPDATE SET NULL ;
CREATE TABLE PROJECT
ProjectID INT PRIMARY KEY,
EmployeeID INT DEFAULT
FOREIGN KEY EmployeeID REFERENCES EMPLOYEE EmployeeID
ON DELETE SET NULL
ON UPDATE CASCADE ;
CREATE TABLE DEPARTMENT
DepartmentID INT PRIMARY KEY,
DepartmentName VARCHAR;
EMPLOYEE
PROJECT
DEPARTMENT
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
