You are on page 1of 18

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. 17
Application of the
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.

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

3
CODING

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")

4
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(va
l_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()

5
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("~~~~~~~~~~~~~~~~~~~~")
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()

6
#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")
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()

7
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=" 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()
8
#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:
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.")

9
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_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:

10
disp_dept_of_selected_em
p() else:

print("EXIT")
break

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

menu()

DATABASE AND TABLES

11
OUTPUT
Main Menu

New employee details

––

12
TOTAL REGISTERED EMPLOYEE

13
Salary of Selected Employee

Department of Selected Employee

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

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

THANK YOU

16

You might also like