Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started