COMPUTER SCIENCE (PYTHON)
EMPLOYEE
MANAGEMENT
SYSTEM
- Priet Ukani
Under the guidance of:- Mr. Kamlesh Raval
Priet Ukani
Puna International School
INDEX
Sr No. Topic Page No.
1. Certificate 2
2. Acknowledgement 3
3. Frontend and 4
Backend tool
4. Coding 5
5. Database and Tables 8
6. Output 9
7. Application of the 12
Project
8. Bibliography 13
1
2
AckNOwLEDGEMENT
I would like to express my sincere thanks
and gratitude to my teacher Mr. Kamlesh
Raval for letting me work on this project. I
am very grateful to him for his support and
guidance in completing this project.
I am thankful to my parents as well. I was
able to successfully complete this project
with the help of their guidance and support.
Finally, I want to thank all my dear friends
as well.
3
FrONTEND AND BAckEND TOOLS
In a computer program/project dedicated for
a specific purpose, we broadly have two
parts or “ends”, the Frontend and the
Backend.
Frontend Tools- Frontend is that part of
the program/project through which the
users interact. It comprises of the User
Interface (UI) to operate the program.
i. Python
(Made using PyCharm Community
Edition 2021.2.11)
Backend Tools- Backend means the
server, application and database that work
behind the scenes to deliver information to
the user.
ii. SQL
(Made using MySQL WorkBench 8.0
CE)
4
cODING
import mysql.connector as myconnector
myconnection=myconnector.connect(host="localhost",password="priet",user="root")
#setting Cursor
mycursor=myconnection.cursor()
#setting Autocommit
myconnection.autocommit=True
#creating Database
mycursor.execute("create database employees")
#setting cursor to use employees database
mycursor.execute("use employees")
#creating a table for storing employeeee details
mycursor.execute("create table tab_emp_details (emp_no int, emp_name varchar(255), emp_dept
varchar(255), emp_salary int, emp_age int)")
#1. Register new employees
def register_emp():
myconnection = myconnector.connect(host="localhost", user="root",
passwd="priet",database="employees")
mycursor=myconnection.cursor()
val_emp_no=int(input("Enter employees ID- "))
val_emp_name=str(input("Enter employees Name- "))
val_emp_dept=input("Enter Department you want to join- ")
val_emp_salary=input("Enter your salary- ")
val_emp_age=input("Enter your Age- ")
insert_query="insert into tab_emp_details values
("+str(val_emp_no)+",'"+val_emp_name+"','"+val_emp_dept+"',"+str(val_emp_salary)+","+str(val_emp_age)+")"
mycursor.execute(insert_query)
myconnection.commit()
print()
print("~~~~~~~~~~~~~~~~~~~~")
print(" Welcome to The Organisation. ")
print(" Your Registration is Complete")
print("~~~~~~~~~~~~~~~~~~~~")
print()
#2. Display all Details of all the Registered employees
def disp_all_details():
myconnection = myconnector.connect(host="localhost", user="root",
passwd="priet",database="employees")
mycursor=myconnection.cursor()
mycursor.execute("select * from tab_emp_details")
results=mycursor.fetchall()
myconnection.commit()
print()
print("~~~~~~~~~~~~~~~~~~~~")
print(" All Information Of All employees. ")
print(" employees ID, employees Name, Department, Salary, Age ")
for emp in results:
print(emp)
print("~~~~~~~~~~~~~~~~~~~~")
5
print()
#3. Update salary of the selected employees
def update_salary_of_selected():
myconnection = myconnector.connect(host="localhost", user="root",
passwd="priet",database="employees")
mycursor=myconnection.cursor()
name=input("Enter your name: ")
newsalary=input("Enter new Salary: ")
mycursor.execute("update tab_emp_details set emp_salary='"+newsalary+"' wher
emp_name='{}'".format(name))
myconnection.commit()
#4. Display employees Names Alphabetically
def disp_emp_name_sorted():
myconnection = myconnector.connect(host="localhost", user="root",
passwd="priet",database="employees")
mycursor=myconnection.cursor()
mycursor.execute("select emp_name from tab_emp_details order by emp_name asc")
enames=mycursor.fetchall()
print()
print("~~~~~~~~~~~~~~~~~~~~")
print(" employees Names in Sorted Order. ")
for ename in enames:
print(ename)
print("~~~~~~~~~~~~~~~~~~~~")
#5. Count the Total Number of Registered employees
def count_reg_emp():
myconnection = myconnector.connect(host="localhost", user="root",
passwd="priet",database="employees")
mycursor=myconnection.cursor()
mycursor.execute("select count(distinct emp_name) from tab_emp_details")
count=mycursor.fetchall()
print()
print("~~~~~~~~~~~~~~~~~~~~")
for x in count:
print(" Total number of registered employees are: ",x)
print("~~~~~~~~~~~~~~~~~~~~")
print()
#6. Display Salary of a specified employees
def disp_salary_of_selected_emp():
myconnection = myconnector.connect(host="localhost", user="root",
passwd="priet",database="employees")
mycursor=myconnection.cursor()
mycursor=myconnection.cursor()
name=input("Enter your Name: ")
mycursor.execute("select emp_salary from tab_emp_details where emp_name='{}'".format(name))
salary=mycursor.fetchall()
print()
print("~~~~~~~~~~~~~~~~~~~~")
for s in salary:
print(name," Your salary is ",s)
myconnection.commit()
print("~~~~~~~~~~~~~~~~~~~~")
print()
#7. To display the department of a particular employees
6
def disp_dept_of_selected_emp():
myconnection = myconnector.connect(host="localhost", user="root",
passwd="priet",database="employees")
mycursor=myconnection.cursor()
name=input("Enter your Name- ")
mycursor.execute("select emp_dept from tab_emp_details where emp_name='{}'".format(name))
department=mycursor.fetchall()
print()
print("~~~~~~~~~~~~~~~~~~~~")
for d in department:
print(name," Your Department is- ",d)
print("~~~~~~~~~~~~~~~~~~~~")
print()
def menu():
print("employees MANAGEMENT SYSTEM")
C="yes"
c=input("Do you want to Continue? ")
while c.lower()=="yes":
print("1. employees Registration.")
print("2. Show Details of all employees.")
print("3. Update salary of a specified employees.")
print("4. Display employees Names in a Sorted Order.")
print("5. Count total Number of employees.")
print("6. Display Salary of the Selected employees.")
print("7. Display department of the Selected employees.")
print("8. EXIT.")
choice=int(input("Enter your Choice ---> "))
if choice==1:
register_emp()
elif choice==2:
disp_all_details()
elif choice==3:
update_salary_of_selected()
elif choice==4:
disp_emp_name_sorted()
elif choice==5:
count_reg_emp()
elif choice==6:
disp_salary_of_selected_emp()
elif choice==7:
disp_dept_of_selected_emp()
else:
print("EXIT")
break
else:
print("BYE!! Thanks for Using the system. ")
menu()
7
DATABASE AND TABLES
8
OUTPUT
Main Menu
New Employee Registration
9
All Employee Details
Total Registered Employees
10
Salary of Selected Employee
Department of Selected Employee
11
APPLIcATIONS
An employee management program has the following
applications along with many others:
Helps to eliminate the manual process and
saves a lot of time and resources
Maintains the personal and professional details
and the company in a safe and secure manner.
The employee management system lowers the
burden on business managers, especially for
those who manage small scale business.
Helps to for better planning and retrospection
of the human resources present in the
business as well as provides an insight of the
workforce to managers.
Fosters transparency and effective
communication.
12
BIBLIOGrAPHY
~ www.tutorialspoint.com
~ www.geeksforgeeks.com
~ www.learnpython.org
~ YouTube Channel Apni Kaksha
~ Introduction to Python Programming by Sumita
Arora Book
THANK YOU
13