0% found this document useful (0 votes)
33 views

Brick Dbms - 1

This document provides an overview of an Employee Management System project implemented using a Database Management System. It discusses the entity relationship model, data definition and manipulation languages used to create tables and perform CRUD operations, and queries using operators. The report also includes acknowledgments.

Uploaded by

samyam.wagle.22
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Brick Dbms - 1

This document provides an overview of an Employee Management System project implemented using a Database Management System. It discusses the entity relationship model, data definition and manipulation languages used to create tables and perform CRUD operations, and queries using operators. The report also includes acknowledgments.

Uploaded by

samyam.wagle.22
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Golden Gate International College

Battisputali, Kathmandu

For the partial fulfillment of faculty of management


BBM 6TH semester
Lab report of Database Management

Submitted by: Submitted to:


Brikshya Subedi Anil Lamichhane
Symbol: 4275

1
Abstract

This report provides overview of Employee Management System (EMS) in the context of a
Database Management System (DBMS) is a comprehensive software solution designed to
efficiently manage and organize employee-related information within an organization. This
system leverages the capabilities of a DBMS to store, retrieve, update, and manipulate data,
ensuring the seamless management of various HR processes. The report will focus on Structured
Query Language (SQL). By utilizing a DBMS, the system ensures data integrity, security, and
scalability, allowing organizations to effectively handle their workforce-related needs.

II
ACKNOWLEDGEMENT

I would like to express my sincere gratitude and appreciation to all those who have contributed to
the successful completion of this Database Management System (DBMS) project.
First and foremost, I extend my heartfelt thanks to my project guide and mentor Professor Mr. Anil
Lamnichanne, for his invaluable guidance, constant encouragement, and insightful feedback
throughout the duration of this project. His expertise and support played a pivotal role in shaping
the direction and scope of the project.
I extend my appreciation to my friends and peers who provided assistance, constructive
discussions, and valuable insights that helped refine the project. Your inputs were instrumental in
overcoming challenges and improving the overall quality of the work.
To everyone who has been a part of this endeavor, whether directly or indirectly, your support has
been crucial, and I am truly thankful for your contributions.

II
Contents
Abstract ............................................................................................................................................ i
ACKNOWLEDGEMENT .............................................................................................................. ii
CHAPTER – 1: .............................................................................................................................. 5
Introduction to Employee Management System ........................................................................ 5
Chapter 2 ....................................................................................................................................... 7
Entity Relationship Model ........................................................................................................... 7
Chapter-3 ....................................................................................................................................... 9
Data Definition Language ............................................................................................................ 9
Create table:................................................................................................................................. 9
ALTER Statement ..................................................................................................................... 15
Add alter: ............................................................................................................................... 15
Alter drop;.............................................................................................................................. 20
ALTER MODIFY.................................................................................................................. 21
Chapter 4: .................................................................................................................................... 22
Data Manipulation Language .................................................................................................... 22
Insert .......................................................................................................................................... 22
Update: ...................................................................................................................................... 28
Delete: ........................................................................................................................................... 32
Chapter 5 ..................................................................................................................................... 33
Data Query Language (DQL) .................................................................................................... 33
And Operator: ............................................................................................................................ 34
Or operator ................................................................................................................................ 35
Not operator............................................................................................................................... 36
Wild card operator ..................................................................................................................... 37
SQL Joins: ................................................................................................................................. 39
Inner Join ............................................................................................................................... 39
Left join ................................................................................................................................. 40
Right join ............................................................................................................................... 41
Oder by clause ........................................................................................................................... 42
Group by clause ......................................................................................................................... 43
Nest Quires ................................................................................................................................ 44

II
CHAPTER – 1:

Introduction to Employee Management System

An Employee Management System (EMS) is a software application designed to streamline and


automate various aspects of employee-related tasks within an organization. The system serves as
a centralized platform that facilitates the efficient management of employee information,
attendance, performance, payroll, and other relevant processes.
The primary objective of an EMS is to enhance operational efficiency, reduce administrative
workload, and ensure accurate and up-to-date employee records. It provides HR departments and
managers with tools to effectively handle workforce-related functions, fostering a more
organized and productive work environment.
Key features of an Employee Management System may include:
Employee Information Management: The system stores comprehensive details about each
employee, such as personal information, contact details, job history, qualifications, and other
relevant data. This information can be easily updated and accessed by authorized personnel.
Attendance and Leave Management: An EMS tracks employee attendance, including clock-
in/clock-out times, breaks, and leaves. It allows employees to request leaves online and enables
managers to approve or decline these requests. The system automatically calculates leave
balances based on accrued time.
Performance Tracking and Appraisal: Performance metrics, goals, and achievements can be
recorded in the system. Regular performance reviews and appraisals can be conducted within the
system, making it easier for managers and employees to track progress and set objectives.
Payroll Processing: Employee Management Systems often integrate with payroll software to
ensure accurate and timely salary processing. Information such as working hours, overtime, and
deductions can be automatically pulled from attendance records.
Document Management: The system can store and manage important employee-related
documents, such as contracts, certifications, and training records. This central repository helps
maintain compliance and simplifies document retrieval.
Communication and Collaboration: Many EMS platforms incorporate communication tools to
facilitate interaction among employees, teams, and management. This can include
announcements, messaging, and discussion forums.

II
 Training and Development: EMS can assist in tracking employee training needs and
progress. It can suggest relevant training programs based on career goals and performance
gaps.
 Analytics and Reporting: The system generates various reports and analytics, such as
attendance summaries, performance evaluations, and turnover rates. These insights enable
data-driven decision-making.

 Security and Access Control: An EMS enforces role-based access control, ensuring that
sensitive employee information is accessible only to authorized personnel.
 Mobile Accessibility: Modern systems often offer mobile apps or responsive interfaces,
allowing employees and managers to access information and perform tasks on the go.

II
Chapter 2

Entity Relationship Model

This ER diagram represents the model of Employee Management System Entity. It shows all
visual instrument of database tables and the relation between Employee ,Department, Project,
Project, Performance and Evaluator.
Entites and Attributes
Employee: (performanceid,attendance id,emailid,dob,address,work ex,emp-id,dept-id)
Project: (proj.id,emp.id,project info,success indicator,dept.id)
Department: ( dept ID,name)
Performance: (proj.id,efficienct score,timliness score,perf.id,quality score,emp id,accuracy score)
Evaluator: ( evaluator id, emp id)
Description
Each entity contain primary key and unique keys
Their id 1 to 1, M to 1 relationship available

Relationship
Employee works on project
Employee evaluated Evaluator
Employee evaluated through Performance
Performance impacts Evaluator
Employee belongs Departments.

II
II
Chapter-3

Data Definition Language

A Data Definition Language (DDL) statement is a type of SQL (Structured Query Language)
statement used to define, manage, and manipulate the structure of a database and its objects.
DDL statements are primarily concerned with the creation, alteration, and deletion of database
objects such as tables, indexes, views, and schemas. They are essential for defining the database
schema and ensuring data integrity. Some common DDL statements include:
 CREATE: Used to create new database objects like tables, indexes, views, and schemas.
For example, CREATE TABLE is used to create a new table in the database.
 ALTER: Allows you to modify the structure of an existing database object. For instance,
ALTER TABLE can be used to add or drop columns from a table.
 DROP: Used to delete database objects. DROP TABLE is used to delete an existing table
along with all its data.
 TRUNCATE: Removes all the data from a table, but the table structure remains intact.
It's faster than the DELETE statement for removing all records.
 RENAME: Changes the name of a database object. For example, RENAME can be used
to rename a table.
 COMMENT: Adds comments or descriptions to database objects. It doesn't affect the
structure but can be useful for documentation.
 GRANT/REVOKE: These statements are used to grant or revoke specific permissions or
privileges on database objects to users or roles.
 Following are the schema relationship:
 Employee: (performanceid,attendance id,emailid,dob,address,work ex,emp-id,dept-id)
 Project: (proj.id,emp.id,project info,success indicator,dept.id)
 Department: ( dept ID,name)
 Performance: (proj.id,efficienct score,timliness score,perf.id,quality score,emp
id,accuracy score)
 Evaluator: ( evaluator id, emp id)

Create table:
Employee

II
II
Project

II
Department

II
Performance table

II
Evaluator

II
ALTER Statement

Add alter:
Employee: phone no.

II
Project: Start Date

II
Department: location

II
Performance: feedback

II
Evaluator: evaluation date

II
Alter drop;
for employee

II
ALTER MODIFY
Employee; address

II
Chapter 4:

Data Manipulation Language

It is used to input new record in the relational table, update the domain values in table and delete
records from table.

Insert:
It is used to input new records in relational table. Insert into 5 record for each tables.

II
Employee:

II
Project:

II
Department:

II
Performance:

II
Evaluator:

II
Update:
It is used to change the domain values in an existing relational table.
PROJECT:

II
DEPARTMENT:

II
PERFORMANCE:

II
EVALUATOR:

II
Delete:
It is used to remove records from relational table.
Q1. Remove empid 1001 from employee

II
Chapter 5

Data Query Language (DQL)


It is used to retrieve or extract information from relational table. It includes following three
command;
Select: It is used to choose attributes to display their records.
From: It is used to select relational table name.
Where: It is used to define the condition.

II
And Operator:
It is used to define in where clause. If all of the given condition are proved, then it returns
information otherwise it doesn’t display the information.
Syntax;
Select column-name(lists)
From table name
Where condition(s);
Example
Employee (performance id , attention id, DOB, work ex, empid, depid)
Project (projectid, empid, project info, success indicator, depid)

Find performance id, attention id, DOB, work ex, empid, depid from employee where address is
pokhara work exp is 5 years .

II
Or operator
It is also used to define where clause. If anyone of a given condition is true then it returns the
information otherwise it doesn’t
Syntax
Select Column name (list)
From table, name
Where condition I or condition II
Example
Employee (performance id , attention id, DOB, work ex, empid, depid)
Project (projectid, empid, project info, success indicator, depid)

Find the employee performance id where address is Pokhara or Dang

II
Not operator

Its is also used in where clause it reverse or opposite information


Syntax
Select column name(list)
From table, name
Where not condition;
Example
Employee (performance id, attention id, DOB, work ex, empid, depid)
Project (projectid, empid, project info, success indicator, depid)
Find performance id of the employee where address isn’t pokhara

II
Wild card operator

Employee (performance id , attention id, DOB, work ex, empid, depid)


Project (projectid, empid, project info, success indicator, depid)
Find performance id of the employee where address end with m

Find the performance id of the employee where address starts with p

II
Find email id & DOB from employee where address start with d & ends with g

Find email id & DOB of the employee where address p at any position

II
SQL Joins:
It is used to retrieve the information from more than one type of table
Inner Join
It is used to retrieve the information from two or more relational table it returns by joining the
relational table with different keys.
Syntax
Select column name (list)
From table I
Inner join table II
Where table I. Column name = table II. Column name;
Example
Employee (performance id , attention id, DOB, work ex, empid, depid)
Project (projectid, empid, project info, success indicator, depid)

II
Left join
If A& B are two relational right & left table respectively then it returns matching value from A &
B reaming value from left table A.
Syntax
Select column name (list)
From table I
Left join table II
Where table I. Column name = table II. Column name;
Example
Employee (performance i, attention id, DOB, work ex, empid, depid)
Project (projectid, empid, project info, success indicator, depid)

II
Right join
If A& B are two relational right & left table respectively then it returns matching value from A &
B reaming value from right table A.
Syntax
Select column name (list)
From table I
Right join table II
Where table I. Column name = table II. Column name;
Example
Employee (performance id attention id, DOB, work ex, empid, depid)
Project (projectid, empid, project info, success indicator, depid)

II
Oder by clause
It used to manage the clause either in ascending order or descending order.
Syntax
Select column name
From table name
Where condition order by column name
Example
Employee (performance id attention id, DOB, work ex, empid, depid)
Project (projectid, empid, project info, success indicator, depid)

II
Group by clause
It used to group the same value & return a summary result
Syntax
Select column name
From table name
Where condition group by column name
Example
Employee (performance id attention id, DOB, work ex, empid, depid)
Project (projectid, empid, project info, success indicator, depid)

II
Nest Quires
It is the complete query embedded within another operation
Example 1
Employee (performance id attention id, DOB, work ex, empid, depid)
Project (projectid, empid, project info, success indicator, depid)

Example 2

II
Example 3

II
View
It is the virtual table based on the result set of sql statement.
Example
Employee (performance id attention id, DOB, work ex, empid, depid)
Project (projectid, empid, project info, success indicator, depid)

II

You might also like