MG 0091.HEIC 9/13/18, 12:10 PM Suppose the following schema for the Department a
ID: 3747006 • Letter: M
Question
MG 0091.HEIC 9/13/18, 12:10 PM Suppose the following schema for the Department and Em Department(Dept ID:integer, Dept_Name:string) Employee(Employee ID:integer, Employee_Name:string) NOTES: You may need to add attributes to some tables for data integrity based on the ER 1. Write the saL, create table for the department table, assign primary key and foreign key accordin ployee t primary key and foreign key according to the ERD (10 points) 2. Write the SQL, create table for the Employee table, assign primary key and foreign key according to the ERD (10 points) about:blank Page 1 ofExplanation / Answer
If you have any doubts, please give me comment...
My constraint:
A department have one or more employees but an employee must work in one department.
1)
CREATE TABLE Department(
Dept_ID INT NOT NULL PRIMARY KEY,
Dept_Name VARCHAR(100)
);
2)
CREATE TABLE Employee(
Employee_ID INT NOT NULL PRIMARY KEY,
Employee_name VARCHAR(100),
Dept_ID INT,
FOREIGN KEY(Dept_ID) REFERENCES Department(Dept_ID)
);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.