0% found this document useful (0 votes)
34 views29 pages

Lovely Professional University

The document discusses designing an employee management system database by describing the entities, attributes, and relationships between them. It outlines the creation of tables in SQL and insertion of sample data. Functions like grouping, filtering, ordering and joining tables are demonstrated.

Uploaded by

Yuvraj Pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views29 pages

Lovely Professional University

The document discusses designing an employee management system database by describing the entities, attributes, and relationships between them. It outlines the creation of tables in SQL and insertion of sample data. Functions like grouping, filtering, ordering and joining tables are demonstrated.

Uploaded by

Yuvraj Pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

LOVELY PROFESSIONAL UNIVERSITY

PROJECT ON:
“Employee Management System”
Done by
Name of Student:Ramineni.Gopichand
Registration Number : 12101028
Roll Number :RK21ANB51

SUBJECT: DATABASE MANAGEMENT


SYSTEM
SUBMITTED TO : Dr.Vijayendra Reddy

“Bachelor of technology in Computer science”


“School of Computer Science and Engineering”
Lovely professional University Phagwara,
Punjab.
CHAPTER-1
ABSTRACT

Employee management system is an application based


system, having two applications developed,
one for employers to manage employee details and another
for employees to mark their attendance.
Every organisation whether government or private uses an
information system to store data of their staff.
However, in India it is found that many small scale industries
use pen and paper to keep a record.
However, there are many advanced technology systems
available that can do this work but they all are costly for these
low level industries.
This paper discusses making a system for solving problems
for them at a cheaper cost.
This system will mark attendance of each employee and
calculate the salary of them at the end of month.
CHAPTER-2
Schema and Normalisation
1. Design
1. E-R Diagram

2. Entities

In total we have 5 entities and information of each entity is


mentioned

1.EMPLOYEE DETAILS:
(e_id,e_name,e_city,e_email,e_gender,e_experience)

The employee is a person who works in a company. The


details
of Employee will present in company data.

E_id=employee’s id
E_name=employee’s name
E_city=employee’s city
E_emil=employee’s e-mail
E_gender=employee ‘s gender
E_experience=employee’s experience
2. DEPARTMENT DETAILS:
(d_id,d_name,d_location)
A department is in which the a particular employee works
Under the department. Every employee has a
department

D_id=department id
D_name=department name
D_location=department location

3. PROJECTS DETAILS:
(p_id,p_name,p_location)

Every employee assigned a project . And the employee


should work on it
P_id=project id
P_name=project name
P_location=project location
4. leave details:
(l_id,e_id,l_date,l_reason)

Here l_id is primary key and e_id is forgein key


The employee takes leave for some reasons
the information will be in leave l_id=leave id
e_id=employee id (forgein key ,refrence from
employee table) l_reason=leave reason

5. salary details:

Here s_id is primary key and e_id is forgein key


Every employee works and take the salary.All the
details of employee salary will be salary
(s_id,s_amount,s_anual,e_id,s_bonus)
S_id=salary id
S_amount=salary amount

S_anual=anual salary
S_bonus=bonus salary
2.1.3 RELATIONSHIP

ER Diagram is known as Entity-Relationship Diagram, it


is used to analyze to structure of the Database. It
shows relationships between entities and their
attributes. An ER Model provides a means of
communication.
ER diagram of Company has the following description :

• Company has several departments.


• Each department may have several Location.
• Departments are identified by a name, D_no,
d_Location.
• A Manager control a particular department.
• Each department is associated with number of
projects.
• Employees are identified by name, e_id, e_city,
e_gender.
• An employee works in only one department but can
work on several project.
• We also keep track of number of hours worked by an
employee on a single project.
• Each employee has dependent
• Dependent has D_name, Gender and relationship.
Entities and their Attributes are
• Employee Entity : Attributes of Employee Entity are
Name, Id, Address, Gender, Dob and Doj.
Id is Primary Key for Employee Entity.
• Department Entity : Attributes of Department Entity
are D_no, Name and Location.
D_no is Primary Key for Department Entity.

• Project Entity : Attributes of Project Entity are P_No,


Name and Location.
P_No is Primary Key for Project Entity.
• leave Entity : Attributes of leave Entity are l_id,
e_id,l_reason and relationship.

• Salary entity : attributes of salary Entity are


s_id,s_amount,s_bonus,s_bonus,and e_id

S_id is a primary key


E_id is forgein key
3. RELATIONSHIP

• Employees works in Departments –


Many employee works in one Department but one
employee can not work in many departments.
Type= many to one
• Department has many Projects –
One department has many projects but one project
can not come under many departments
Type=one to many
• Employee works on project –
One employee works on several projects and the
number of hours worked by the employee on a
single project is recorded.
Type=one to many

• Employee takes leave– one Employee has many


leave .so, it is one to many relationship
Type=one to many

Employee takes salary –


One employee can take only one salary . But in one
company their exits same salary for some employee so
it is n to 1 relationship
2. Normalisation

1. Functional Dependency

1. employee table
• {e_id}=e_email(functional dependency exits
because two different e_email do not correspond
to same e_id)

• {e_id}=e_city
• {e_id}=e_name(functional dependency exits)
• {e_id}=e_experience(functional dependency
exits)

2. Department details :
• {d_id}=d_name(functional dependency exits)

• {d_id}=d_location (functional dependency exits )


3.project details :
• {p_id}=p_name(functional dependency exits)

• {p_id}=p_location(functional dependency exits)

4.leave details :
• {l_id}=l_date(functional dependency exits)

• {l_id}=l_reason(functional dependency exits)

CHAPTER-3

PL/SQL
3.1 SQL Table
Creation
The Implementation of SQL
server is given below :-

CREATE
TABLE
employee (
e_id int PRIMARY KEY,
e_name varchar(255),
e_city varchar(255),
Email varchar(255),
varchar(255),
e_experience number(5)
);

create table dept2


(
d_id INT primary
key NOT NULL,
d_name varchar(35), d_location
varchar(10)
);

create table projects


(
p_id INT primary key NOT NULL,
p_name varchar(35), p_location
varchar(10)
);

CREATE TABLE leaves ( l_id int


NOT NULL, e_id int NOT NULL,
l_date varchar(100) NOT NULL,
PRIMARY KEY (l_id),
FOREIGN KEY (e_id)
REFERENCES employee(e_id)
);
CREATE TABLE salary ( s_id
int NOT NULL, e_id int NOT
NULL, s_amount number NOT
s_anual number NOT
NULL, s_bonus number NOT

NULL,
PRIMARY KEY (s_id),

FOREIGN KEY (e_id) REFERENCES employee(e_id));


NULL, 3.2 Data Entry

insert into employee values


(1,'Ram','hyderabad','[email protected]','male',3); insert
into employee values
(2,'Rahul','Banglore','[email protected]','male',2);
insert into employee values
(3,'Rakshit','mumbai','[email protected]','male',6);
insert into employee values
(4,'Ramesh','hyderabad','[email protected]','male',1); insert
into employee values
(5,'anu','pune','[email protected]','female',4); insert
into employee values
(6,'sumith','hyderabad','[email protected]','male',3);
insert into employee values
(7,'Bhargavi','pune','[email protected]','female',7);
insert into employee values
(8,'Radha','hyderabad','[email protected]','female',5);
insert into employee values
(9,'Rakesh','mumbai','[email protected]','male',6);
insert into employee values
(10,'srinish','Banglore','[email protected]','male',9);

#display all employee details


select * from employee

#display how many employee are there in respective city select


e_city, count(*) from employee group by e_city;
#display the employee name whose experience is greater than 5

select e_name from employee


where e_experience>5;

#display the employee in alphabetical order


select*from employee order by e_name;

#diplay the employee who has work experience more than 3 and lives in pune
select e_name from employee where e_experience>3 and e_city='pune';
insert into dept2 values (1,'HR department','hyderabad'); insert
into dept2 values (2,'marketing department','Bangalore');
insert into dept2 values (3,'finance department','pune'); insert
into dept2 values (4,'sales department','mumbai'); insert into
dept2 values (5,'HR department','chennai'); insert into dept2
values (6,'HR department','Bangalore'); insert into dept2 values
(7,'sales department','hyderabad'); insert into dept2 values
(8,'finance department','pune'); insert into dept2 values (9,'HR
department','hyderabad'); select * from dept2
select d_name, count(*) from department group by d_name;

select * from department


where d_name='hyderabad';

select * from department

where d_location='mumbai' or d_location='pune';


insert into projects values (1,'web developing','hyderabad');
insert into projects values (2,'software
updates','hyderabad'); insert into projects values (3,'staff
updates','Bangalore'); insert into projects values (4,'company
web page','pune'); insert into projects values (5,'web
developing','mumbai'); insert into projects values (6,'staff
updates','chennai'); insert into projects values (7,'software
updates','Bangalore'); insert into projects values (8,'web
developing','hyderabad'); insert into projects values
(9,'software updates','pune'); insert into projects values
(10,'web developing','hyderabad'); select * from projects;
select p_name, count(*) from projects;

select p_name, count(*) from projects group by p_name;

select * from projects where


p_name='web developing';
insert into leave values (1,2,'15-11-2022','fever');
insert into leave values (2,3,'17-11-2022','trip'); insert
into leave values (3,4,'16-11-2022','vacation'); insert
into leave values (4,5,'18-11-2022','typhoid'); insert
into leave values (5,6,'19-11-2022','sick'); insert into
leave values (6,7,'20-11-2022','fever'); insert into
leave values (7,8,'25-11-2022','trip'); insert into leave
values (8,9,'21-11-2022','vacation'); insert into leave
values (9,2,'24-11-2022','trip'); insert into leave
values (10,4,'25-11-2022','sick');

select * from leave;


select * from employee
where e_id in (select e_id from leave);

SELECT leave.l_id, employee.e_id, leave.l_date,leave.l_reason


FROM leave
INNER JOIN employee ON leave.e_id=employee.e_id;
insert into salary values (1,2,35000,400000,5000);
insert into salary values (2,5,45000,500000,5000);
insert into salary values (3,6,55000,600000,5000);
insert into salary values (4,7,65000,700000,5000);
insert into salary values (5,8,75000,800000,5000);
insert into salary values (6,9,85000,900000,5000);

select * from salary;


pl sql

declare total
number(2):=0;
begin
select count(*) into total from
employee;

dbms_output.put_line(total);
end;
declare total
number(2):=0;
begin
select count(*) into total from
employee
where e_city='hyderabad' and e_experience>3;
dbms_output.put_line(total); end;
declare total
number(2):=0;

procedure counting(z out number) is begin


select count(*) into z from
employee
where e_city='hyderabad' and e_experience>=3;
end; begin counting(total); if total >= 3 then
dbms_output.put_line('this is acceptable');
else
dbms_output.put_line('this is not acceptable');
end if; end;
declare
ee_id employee.e_id%type; ee_city
employee.e_city%type; cursor
curs_emp is
select e_id,e_name from employee;
begin open curs_emp;

fetch curs_emp into ee_id,ee_city;

close curs_emp;
dbms_output.put_line(ee_id ||
ee_city); end;
declare
ee_id employee.e_id%type; ee_city
employee.e_city%type; ee_experience
employee.e_experience%type; cursor cust_e
is
select e_id,e_city,e_experience from employee;
begin open cust_e; loop
fetch cust_e into ee_id,ee_city,ee_experience; exit
when cust_e%notfound;
dbms_output.put_line('the employee id is '||ee_id|| ' works in' ||
ee_city|| 'and experience is'|| ee_experience); end loop; close
cust_e; end;
CONCLUSION
Software for employee management systems helps
your organization improve workforce productivity and
boost overall well-being by tracking and monitoring the
daily working activities of every employee. DeskTrack
is the best employee productivity monitoring software
for workforce management. It keeps track of every
activity done by an employee during his working hours.
As a result, if you are searching for the best employee
productivity monitoring software then DeskTrack has
some impressive features that can be the best fit for
your organization.

You might also like