logo

Employee Database Management

   

Added on  2019-09-21

15 Pages704 Words88 Views
 | 
 | 
 | 
EMPLOYEE DATABASE Student Name: Student ID: Course Name: Course ID:Faculty Name: University Name:
Employee Database Management_1

ContentsA)ER DIAGRAM.....................................................................................................................2B) CREATE TABLE COMMANDS..............................................................................................3Deparment Table.........................................................................................................................3Employee Table...........................................................................................................................3Project Table................................................................................................................................4WorksOn Table............................................................................................................................4C) SCREEN SHOTS OF SAMPLE DATA....................................................................................4SQL QUERIES................................................................................................................................7
Employee Database Management_2

A)ER DIAGRAM
Employee Database Management_3

B) CREATE TABLE COMMANDSCREATE DATABASE EMP_DB_SYSTEM;USE EMP_DB_SYSTEM;Deparment TableCREATE TABLE Department( deptNo INT PRIMARY KEY, deptName VARCHAR(40) NOT NULL, mgrEmpID INT UNIQUE DEFAULT NULL);Employee TableCREATE TABLE Employee( empID INT PRIMARY KEY, fName VARCHAR(10) NOT NULL, lName VARCHAR(10) NOT NULL, address VARCHAR(100) NOT NULL, dob DATE NOT NULL, sex ENUM('M','F') NOT NULL, position VARCHAR(40) NOT NULL, deptNo INT NOT NULL,FOREIGN KEY (deptNo) REFERENCES Department(deptNo));ALTER TABLE Department ADD FOREIGN KEY (mgrEmpID) REFERENCES Employee(empID);
Employee Database Management_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Database Design and SQL Queries
|14
|1619
|106