Question: Create the rest of the SQL code for the tables remaining in the picture provided. I have the code already for the first three tables
Create the rest of the SQL code for the tables remaining in the picture provided. I have the code already for the first three tables and will provide it below. Create the code in a similar format please and thank you
SQL CODE:
CREATE TABLE EMPLOYEEmaw
SSNNumber CHAR NOT NULL,
FirstName VARCHAR NOT NULL,
MidName CHAR,
LastName VARCHAR NOT NULL,
Birthday DATE,
Address VARCHAR
Gender CHAR CHECK Gender IN MFmf
Salary DECIMAL DEFAULT
SupervisorSSN CHAR
DepartmentNumber INT,
CONSTRAINT EMPLOYEEPK PRIMARY KEYSSNNumber
CONSTRAINT EMPLOYEEFK FOREIGN KEYSupervisorSSN REFERENCES EMPLOYEEmawSSNNumber;
CREATE TABLE DEPARTMENTmaw
DepartmentName VARCHAR NOT NULL,
DepartmentNumber INT NOT NULL,
ManagerSSN CHAR NOT NULL,
ManageStartDate DATE,
PRIMARY KEY DepartmentNumber
CONSTRAINT DEPARTMENTFK FOREIGN KEY ManagerSSN REFERENCES EMPLOYEEmaw SSNNumber;
CREATE TABLE DEPTLOCATIONmaw
DepartmentNumber INT,
DepartmentLocation VARCHAR
CONSTRAINT PKDEPTLOCATION PRIMARY KEY DepartmentNumber
CONSTRAINT FKDEPTLOCATIONDEPARTMENT FOREIGN KEY DepartmentNumber REFERENCES DEPARTMENTmaw DepartmentNumber ON DELETE CASCADE;
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
