0% found this document useful (0 votes)
150 views17 pages

Employee Management System: Computer Science (Python)

This document describes an employee management system project created using Python and MySQL. The project uses Python for the frontend and MySQL for the backend database. It includes functions for registering new employees, displaying employee details, updating salaries, sorting employee names, counting employees, and displaying additional employee information. The output section shows sample interactions with the menu-driven system. Applications of the project include streamlining HR processes, maintaining secure employee data, and providing insights into the workforce.

Uploaded by

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

Employee Management System: Computer Science (Python)

This document describes an employee management system project created using Python and MySQL. The project uses Python for the frontend and MySQL for the backend database. It includes functions for registering new employees, displaying employee details, updating salaries, sorting employee names, counting employees, and displaying additional employee information. The output section shows sample interactions with the menu-driven system. Applications of the project include streamlining HR processes, maintaining secure employee data, and providing insights into the workforce.

Uploaded by

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

COMPUTER SCIENCE (PYTHON)

EMPLOYEE
MANAGEMENT
SYSTEM

NAME:- Samyak VishalKumar Gandhi


GUIDED BY:- Mr. Kamlesh Raval
Mrs. Jayna Ma’am
School name:- Puna International School
INDEX

Sr No. Topic Page


No.
1. Overview 1

2. Certificate 2

3. Index 3

4. Acknowledgement 4

3. Frontend and Backend tool 5

4. Coding 6

5. Database and Tables 13

6. Output 14

7. Application of the 17
Project

8. Bibliography 18

1
ACKNOWLEDGEMENT
I would like to thank Mrs. Jayna Ma’am who
gave me a golden Opportunity to work on this
project. I’d also like to Express my gratitude to
my school Principal Sadhana Ma’am
wholeheartedly
I must also thank my parents and friends for
the immense support and help during this
project.

FRONTEND AND BACKEND TOOLS


2
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.0CE)

CODING
3
import mysql.connector as myconnector
myconnection=myconnector.connect
(host="localhost",password="samyak" ,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="samyak",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
4
("+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="
samyak ",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=" samyak ",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="samyak",database="
employees")
mycursor=myconnection.cursor()
mycursor.execute
("select emp_name from tab_emp_details order by
emp_name asc")
6
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="samyak ",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()
:
7
myconnection = myconnector.connect
(host="localhost", user="root", passwd=" samyak
" ,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

def
disp_dept_of_selected_emp():
myconnection = myconnector.connect(host="localhost",
user="root", passwd=" samyak ", 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:

8
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:
9
update_salary_of_selecte
d() elif choice==4:

disp_emp_name_sorte
d() elif choice==5:

count_reg_emp()
elif choice==6:

disp_salary_of_selected_e
mp() elif choice==7:

disp_dept_of_selected_em
p() else:

print("EXIT")
break

else:
print("BYE!! Thanks for Using the system. ")

menu()

10
DATABASE AND TABLES

OUTPUT

11
Main Menu

New employee details

––

12
TOTAL REGISTERED EMPLOYEE

13
Salary of Selected Employee

Department of Selected Employee

APPLICATIONS OF PROJECT
14
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.

BIBLIOGRAPHY
~ www.compstudio.com
15
~ www.learnpython.org
~ YouTube Channel
~ Introduction to Python Programming by Sumita
Arora Book

THANK YOU

16

You might also like