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 EMPLOYEE_maw
(SSN_Number CHAR(9) NOT NULL,
First_Name VARCHAR(15) NOT NULL,
Mid_Name CHAR,
Last_Name VARCHAR(15) NOT NULL,
Birthday DATE,
Address VARCHAR(50),
Gender CHAR CHECK (Gender IN ('M','F','m','f')),
Salary DECIMAL DEFAULT 80000,
Supervisor_SSN CHAR(9),
Department_Number INT,
CONSTRAINT EMPLOYEE_PK PRIMARY KEY(SSN_Number),
CONSTRAINT EMPLOYEE_FK FOREIGN KEY(Supervisor_SSN) REFERENCES EMPLOYEE_maw(SSN_Number));
CREATE TABLE DEPARTMENT_maw
(Department_Name VARCHAR(15) NOT NULL,
Department_Number INT NOT NULL,
Manager_SSN CHAR(9) NOT NULL,
ManageStartDate DATE,
PRIMARY KEY (Department_Number),
CONSTRAINT DEPARTMENT_FK FOREIGN KEY (Manager_SSN) REFERENCES EMPLOYEE_maw (SSN_Number));
CREATE TABLE DEPT_LOCATION_maw
(Department_Number INT,
Department_Location VARCHAR(15),
CONSTRAINT PK_DEPT_LOCATION PRIMARY KEY (Department_Number),
CONSTRAINT FK_DEPT_LOCATION_DEPARTMENT FOREIGN KEY (Department_Number) REFERENCES DEPARTMENT_maw (Department_Number) ON DELETE CASCADE);
 Create the rest of the SQL code for the tables remaining

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!