Answered step by step
Verified Expert Solution
Link Copied!

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 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);
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Ehs 2.0 Revolutionizing The Future Of Safety With Digital Technology

Authors: Tony Mudd

1st Edition

B0CN69B3HW, 979-8867463663

More Books

Students also viewed these Databases questions