EMPLOYEE DATABASE.

Added on - 21 Sep 2019

  • 15

    pages

  • 704

    Words

  • 272

    Views

  • 0

    Downloads

Showing pages 1 to 4 of 15 pages
EMPLOYEE DATABASEStudent Name:Student ID:Course Name:Course ID:Faculty Name:University Name:
ContentsA)ER DIAGRAM.....................................................................................................................2B) CREATE TABLE COMMANDS..............................................................................................3Deparment Table.........................................................................................................................3Employee Table...........................................................................................................................3Project Table................................................................................................................................4WorksOn Table............................................................................................................................4C) SCREEN SHOTS OF SAMPLE DATA....................................................................................4SQL QUERIES................................................................................................................................7
A)ER DIAGRAM
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) REFERENCESEmployee(empID);
desklib-logo
You’re reading a preview
card-image

To View Complete Document

Become a Desklib Library Member.
Subscribe to our plans

Download This Document