0% found this document useful (0 votes)
19 views19 pages

Employee Management System Overview

Class X11 CSC Project for reference

Uploaded by

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

Employee Management System Overview

Class X11 CSC Project for reference

Uploaded by

chaitanyafam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

EMPLOYEE

MANAGEMENT SYSTEM
TABLE OF CONTENTS

1. Project Description
2. Glimpses of Python
3. Glimpses of MySQL
4. Hardware and
Software Configuration
5. Tables in the Database
6. Source code
7. Output
8. Bibliography
PROJECT DESCRIPTION
The project Employee Management System uses Python as front end
and MySql as backend. It aims to maintain the details of Employee details
in a systematic way.
Employee details are stored in Mysql table for easy retrieval and access.
The following functionalities are included in the project:
• Adding Employee Details
• Display Employee Details
• Search Employee Details
• Update Employee Details
• Delete Employee Details
• Generation of Pay Slip
GLIMPSES OF PYTHON
• Python is a high-level, general-purpose, self- contained programming
language designed to meet the needs of computer scientists,
software developers and college students interested in coding.

• Python was created in the early 1980s by Guido van Rossum.

• Python is a high-level, interpreted, dynamic object-oriented


programming language that can be used to program applications or
web sites.

• It is also known as an object-oriented programming (OOP) language.


The main benefits of using Python instead of other languages are that
it is very easy to start programming with and because of its flexible
syntax, it can be used to program almost any kind of software
application.

• Python is an open source language that’s free to use and has a wide
range of features that make it easy to customize.
Python Features and Advantages
• Easy to Code. Python is a very high-level programming language, yet
it is effortless to learn.
• Easy to Read. Python code looks like simple English words.
• Free and Open-Source.
• Robust Standard Library.
• Interpreted.
• Portable.
• Object-Oriented and Procedure-Oriented.
• Extensible.
GLIMPSES OF MYSQL
MySQL is a system that helps to store and manage data efficiently.
Database generally stores data in a structured fashion.

SALIENT FEATURES OF MYSQL


Quick and Reliable
MySQL stores data efficiently in the memory ensuring that data is
consistent, and not redundant. Hence, data access and manipulation using
MySQL is quick.
Free to download
MySQL is free to use so that we can download it from MySQL official
website without any cost.
Scalable
Scalability refers to the ability of systems to work easily with small amounts
of data, large amounts of data, clusters of machines, and so on. MySQL
server was developed to work with large databases.
Data Types
It contains multiple data types such as unsigned integers, signed integers,
float (FLOAT), double (DOUBLE), character (CHAR), variable character
(VARCHAR), text, blob, date, time, datetime, timestamp, year, and so on.
Secure
It provides a secure interface since it has a password system which is
flexible, and ensures that it is verified based on the host before accessing
the database. The password is encrypted while connecting to the server.
Support for large databases
MySQL has no limit on the number of databases. The underlying filesystem
may have a limit on the number of [Link] has no limit on the
number of tables. The underlying file system may have a limit on the
number of files that represent tables. Individual storage engines may
impose engine-specific constraints. InnoDB permits up to 4 billion tables.
Client and Utility Programs
MySQL server also comes with many client and utility programs. This
includes Command line programs such as ‘mysqladmin’ and graphical
programs such as ‘MySQL Workbench’. MySQL client programs are written
in a variety of languages. Client library (code encapsulated in a module)
can be written in C or C++ and would be available for clients that have C
bindings.
Compatible on many operating systems
MySQL is compatible to run on many operating systems, like Novell
NetWare, Windows* Linux*, many varieties of UNIX* (such as Sun*Solaris*,
AIX, and DEC* UNIX), OS/2, FreeBSD*, and others. MySQL also provides
a facility that the clients can run on the same computer as the server or on
another computer (communication via a local network or the Internet).
GUI Support
MySQL provides a unified visual database graphical user interface tool
named "MySQL Workbench" to work with database architects, developers,
and Database Administrators.
HARDWARE AND
SOFTWARE
CONFIGURATION
HARDWARE
• Operating System : Windows 10 or above

• Processor : Pentium 2.6GHz

• RAM : 4GB

• HardDisk : SSD 128GB

SOFTWARE
• Windows OS

• Python 3.8 or above

• MySQL 8.0 Command Line Client


TABLES IN THE
DATABASE
SOURCE CODE
import [Link] as ms
mycon =
[Link](host='localhost',user="root",password="password",database="
Empdb")
mycursor = [Link]()

def Display():
global mycon,mycursor
try:
inpstrquery="select * from emp"
[Link](inpstrquery)
results = [Link]()
print("**************************************************")
print('%5s'%"EMPNO",'%15s'%'EMP
NAME','%12s'%'DEPARTMENT','%10s'%'SALARY')
print("**************************************************")
count=0
for row in results:
print('%5s' % row[0],'%15s'%row[1],'%12s'%row[2],'%10s'%row[3])

print("*************** TOTAL RECORD :


",[Link],"**********")
except:
print("error")

def insertEmp():
global mycon,mycursor
print("*******************ADD NEW
EMPLOYEE**************************")
eno = int(input("Enter employee number :"))
en = input("Enter employee name :")
dp = input("Enter department ")
sl = int(input("Enter Salary :"))
inpstrQuery="insert into emp values({},'{}','{}',{})".format(eno,en,dp,sl)
[Link](inpstrQuery)
[Link]()
print("\nRECORD ADDED SUCCESSFULLY!")

def searchEmp():
global mycon,mycursor
print("*******************SEARCH EMPLOYEE FORM
**************************")
en = int(input("Enter Employee number to search :"))
inpstrQuery="select * from emp where empno={}".format(en)
[Link](inpstrQuery)
results = [Link]()
if [Link]<=0:
print("\n SORRY! NO MATCHING DETAILS AVAILABLE!")
else:

print("**************************************************")
print('%5s'%"EMPNO",'%15s'%'EMP
NAME','%12s'%'DEPARTMENT','%10s'%'SALARY')
print("**************************************************")
for row in results:
print('%5s' % row[0],'%15s'%row[1],'%12s'%row[2],'%10s'%row[3])
print("-"*50)

def updateEmp():
global mycon,mycursor
print("*******************UPDATE EMPLOYEE FORM
**************************")
en = int(input("Enter Employee number to update :"))
inpstrquery="select * from emp where empno={}".format(en)
[Link](inpstrquery)
results = [Link]()
if [Link]<=0:
print("SORRY! NO MATCHING DETAILS AVAILABLE")
else:
print("**************************************************")
print('%5s'%"EMPNO",'%15s'%'EMP
NAME','%12s'%'DEPARTMENT','%10s'%'SALARY')
print("**************************************************")
for row in results:
print('%5s' % row[0],'%15s'%row[1],'%12s'%row[2],'%10s'%row[3])
print("-"*50)
ans = input("Are you sure to update ? (y/n)")
if ans=="y" or ans=="Y":
d = input("Enter new department to update (enter old value if not to
update) :")
s = int(input("Enter new salary to update (enter old value if not to
update) :"))
inpstrquery="update emp set dept='{}',salary={} where
empno={}".format(d,s,en)
[Link](inpstrquery)
[Link]()
print("\nRECORD UPDATED")

def deleteEmp():
global mycon,mycursor

print("*******************DELETE EMPLOYEE FORM


**************************")
en = int(input("Enter Employee number to delete :"))
inpstrQuery="select * from emp where empno={}".format(en)
[Link](inpstrQuery)
results = [Link]()
if [Link]<=0:
print("\## SORRY! NO MATCHING DETAILS AVAILABLE ##")
else:

print("**************************************************")
print('%5s'%"EMPNO",'%15s'%'EMP
NAME','%12s'%'DEPARTMENT','%10s'%'SALARY')
print("**************************************************")
for row in results:
print('%5s' % row[0],'%15s'%row[1],'%12s'%row[2],'%10s'%row[3])
print("-"*50)

ans = input("Are you sure to delete ? (y/n)")


if ans=="y" or ans=="Y":
inpstrquery="delete from emp where empno={}".format(en)
[Link](inpstrquery)
[Link]()
print("\n RECORD DELETED")

def generateSlip():

global mycon,mycursor
print("*******************SALARY SLIP
**************************")
en = int(input("Enter Employee number to print salary slip :"))
query="select * from emp where empno="+str(en)
[Link](query)
results = [Link]()
if [Link]<=0:
print("\n SORRY! NO MATCHING DETAILS AVAILABLE ")
else:
print("EMPNO :",results[0]," "*20,"NAME :",results[1])
print("DEPARTMENT :",results[2])
print("*"*50)
s = int(results[3])
hra = s * 12/100
da = s * 15/100
it = 1000
gross = s +hra+da
ded = it
net = gross - ded
print("%19s"%"EARNING","%27s"%"DEDUCTION")
print("-------------------------------------------------")
print("%20s"%"Basic :"+str(s),"%22s"%"INC. TAX :"+str(it))
print("%20s"%"HRA :"+str(hra))
print("%20s"%"DA :"+str(da))
print("-"*50)
print(" GROSS :",gross," NET SALARY :",net," TOTAL DED :",ded)
print("-"*50)

while True:
print("*******************EMPLOYEE MANAGEMENT SYSTEM
**************************")
print("1. SHOW EMPLOYEE LIST ")
print("2. ADD NEW EMPLOYEE")
print("3. SEARCH EMPLOYEE ")
print("4. UPDATE EMPLOYEE ")
print("5. DELETE EMPLOYEE ")
print("6. GENERATE PAY SLIP ")
print("7. EXIT")
print("*********************************************
**************************")
ans = int(input("Enter your choice :"))
if ans==1:
Display()
elif ans==2:
insertEmp()
elif ans==3:
searchEmp()
elif ans==4:
updateEmp()
elif ans==5:
deleteEmp()
elif ans==6:
generateSlip()
elif ans==7:
[Link]()
break
else:
print("\nInvalidChoice!!")
OUTPUT
BIBLIOGRAPHY

• Computer Science with Python –


Sumitha Arora
Preethi Arora

Common questions

Powered by AI

The MySQL database used in the Employee Management System incorporates several security measures to protect employee information. These include the use of a flexible password system that controls access by verifying credentials based on the host, with password encryption during connections to prevent unauthorized access. MySQL also ensures data consistency and prevents redundancy which aids in maintaining data integrity. These security protocols safeguard sensitive employee information and uphold confidentiality within the system .

MySQL supports a variety of key data types including unsigned and signed integers, floats, doubles, chars, variable chars, text, blobs, and date/time related types like datetime and timestamp. These data types are important for handling employee records effectively as they allow for precise data representation and storage. For instance, integers can store employee IDs, strings (chars and varchars) handle names and departments, and date types manage dates of employment and other time-sensitive data. This ensures efficient data retrieval and manipulation, enhancing database performance and accuracy .

Python was chosen as the programming language for the Employee Management System due to its high-level, interpreted, and dynamic nature, which makes it easy to code and read. Its flexibility and object-oriented features allow for efficient development of various software applications. Additionally, Python’s extensive standard library supports rapid development and customization, and its open-source nature makes it freely available, thereby minimizing project costs .

MySQL Workbench plays a crucial role in the management of databases within the Employee Management System by providing a unified visual database graphical user interface (GUI) that simplifies tasks for database administrators and developers. It allows for intuitive design, development, and administration of databases, facilitating diagrammatic representation of schemas, writing and optimizing queries, and managing database operations efficiently. This tool enhances productivity by offering visual engagement in tasks that would otherwise require intricate command-line skills, streamlining database management processes and facilitating easier debugging and maintenance .

Managing concurrency and data consistency in MySQL databases involves ensuring that multiple operations can occur simultaneously without compromising data integrity. Challenges include possible conflicts from concurrent data access and operations, such as read/write anomalies, which can lead to inconsistent data states. Solutions include implementing locking mechanisms that control access to data pieces or entire tables during operations, using transactions to ensure atomicity and isolation of operations, and leveraging InnoDB’s ACID compliance for managing complex transactions. These strategies help maintain data consistency and support reliable multi-user access in systems like the Employee Management System .

The critical hardware configurations required for implementing the Employee Management System include having an operating system of Windows 10 or above, a processor of at least Pentium 2.6GHz, 4GB of RAM, and a hard disk with at least 128GB SSD capacity. On the software side, the required configurations include having Windows OS, Python 3.8 or above, and MySQL 8.0 Command Line Client .

The system facilitates the generation of pay slips for employees by executing specific queries to retrieve employee details, including their salary, from the database. The process involves calculating house rent allowance (HRA) as 12% of the basic salary, dearness allowance (DA) as 15% of the basic salary, and incurs income tax (IT) as a fixed amount (e.g., 1000). The gross salary is then computed as the sum of the basic salary, HRA, and DA, from which the income tax is deducted to obtain the net salary. These calculations are presented in a structured pay slip format for each requested employee .

The integration of Python and MySQL enhances the functionality of an Employee Management System by leveraging Python's ease of use, object-oriented capabilities, and extensive libraries for interfacing with databases, alongside MySQL’s robust and secure data storage capability. Python serves as an efficient front-end for developing the application interface, allowing developers to quickly implement and modify features like adding, displaying, and updating employee details. On the other hand, MySQL's capacity to handle large databases with high-speed access and manipulation ensures that employee data is stored efficiently, securely, and can be managed effectively. This combination allows the system to support various functionalities such as generating pay slips and securely managing employee information .

Python offers several advantages as a front-end programming language in database management systems, such as ease of learning and readability due to its simple syntax, making development efficient and accessible. It also has a robust standard library and extensive community support, providing numerous tools and frameworks for integrating with databases like MySQL. However, potential limitations may include performance overheads, as Python is interpreted and may be slower than compiled languages for execution-intensive tasks. Additionally, it may require third-party libraries to achieve certain functionalities that are natively supported in other languages .

MySQL provides robust support for managing large datasets, making it suitable for backend database technology in employee management systems, by offering features such as scalability, which allows it to handle both small and large datasets efficiently. It supports various data types and has no practical limit on the number of databases, which aids in managing extensive data collections. MySQL also ensures data consistency and security through its built-in password protection and encrypted connections. Additionally, MySQL's compatibility with many operating systems and its capability to provide both command-line and GUI tools for database management enhance its suitability for enterprise-level applications .

You might also like