Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create the SQL coe for the Dependent table shown in the picture. Te rest of the SQL code for the other tables will be provided

Create the SQL coe for the Dependent table shown in the picture. Te rest of the SQL code for the other tables will be provided below
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 TABLE PROJECT_maw
(Project_Name VARCHAR(15) UNIQUE NOT NULL,
Project_Number INT PRIMARY KEY,
Project_Location VARCHAR(15),
Department_Number INT,
CONSTRAINT PROJECT_maw_FK FOREIGN KEY (Department_Number) REFERENCES DEPARTMENT_maw(Department_Number));
CREATE TABLE PROJECT_ASSIGNMENT_maw
(Employee_SSN CHAR(9),
Project_Number INT,
Hours DECIMAL(3,1) NOT NULL,
CONSTRAINT PROJECT_ASSIGNMENT_maw_PK PRIMARY KEY (Employee_SSN, Project_Number),
CONSTRAINT PROJECT_ASSIGNMENT_maw_EMP_FK FOREIGN KEY (Employee_SSN) REFERENCES EMPLOYEE_maw(SSN_Number) ON DELETE CASCADE,
CONSTRAINT PROJECT_ASSIGNMENT_maw_PROJ_FK FOREIGN KEY (Project_Number) REFERENCES PROJECT_maw(Project_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

Intelligent Information And Database Systems Second International Conference Acids Hue City Vietnam March 2010 Proceedings Part 1 Lnai 5990

Authors: Manh Thanh Le ,Jerzy Swiatek ,Ngoc Thanh Nguyen

2010th Edition

3642121446, 978-3642121449

More Books

Students also viewed these Databases questions

Question

explain what is meant by experiential learning

Answered: 1 week ago

Question

identify the main ways in which you learn

Answered: 1 week ago