Employee Management System: Computer Science (Python)
Employee Management System: Computer Science (Python)
EMPLOYEE
MANAGEMENT
SYSTEM
2. Certificate 2
3. Index 3
4. Acknowledgement 4
4. Coding 6
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.
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")
print("~~~~~~~~~~~~~~~~~~)
print("Welcome to The
Organisation. ")
print(" Your Registration is
Complete")
print("~~~~~~~~~~~~~")
print()
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()
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("~~~~~~~~~~~~~~~~~~~~")
print("~~~~~~~~~~~~~~~~
~~~~") for x in count:
print(" Total number of registered
employees are: ",x)
print("~~~~~~~~~~~~~~~~~~~~")
print()
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.")
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
––
12
TOTAL REGISTERED EMPLOYEE
13
Salary of Selected Employee
APPLICATIONS OF PROJECT
14
An employee management program has the following
applications along with many others:
BIBLIOGRAPHY
~ www.compstudio.com
15
~ www.learnpython.org
~ YouTube Channel
~ Introduction to Python Programming by Sumita
Arora Book
THANK YOU
16