100% found this document useful (1 vote)
752 views20 pages

PAWAN

This document describes a Python project for an employees data management system created by Pawan Kumar, a class 12 student. The project allows users to add new employee details, update employee salaries, delete employee details, search for employee details, and export data to Microsoft Excel. The project connects to an SQL database using the mysql.connector module and uses various Python functions.

Uploaded by

Pawan Kumar
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
100% found this document useful (1 vote)
752 views20 pages

PAWAN

This document describes a Python project for an employees data management system created by Pawan Kumar, a class 12 student. The project allows users to add new employee details, update employee salaries, delete employee details, search for employee details, and export data to Microsoft Excel. The project connects to an SQL database using the mysql.connector module and uses various Python functions.

Uploaded by

Pawan Kumar
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/ 20

A PROJECT OF PYTHON ON

EMPLOYEES DATA MANAGEMENT SYSTEM

SUBMITTED BY
Pawan Kumar
CLASS: XII-A
BOARD ROLL NO- 13629101

UNDER THE GUIDANCE OF


Mrs. PAYAL SHARMA(PGT)
COMPUTER SCIENCE
CERTIFICATE
This is to certify that Pawan Kumar of
class XII-A has prepared the report on the
project entitled “EMPLOYEES DATA
MANAGEMENT SYSTEM”.

The report is the result of his efforts and


endeavours. The report is found worthy
of acceptance as final project report for
the Computer Science of Class XII. He has
prepared the report under my guidance.

Mrs. PAYAL SHARMA


PGT (Computer Science)
DEPARTMENT OF COMPUTER SCIENCE
ACKNOWLEDGEMENT
I would like to express a deep sense of thanks &
gratitude to my project guide Mrs. Payal Sharma
for guiding me immensely through the course of
project. She always evinced keen interest in my
work. Her constructive advice & constant
motivation has been responsible for the
successful completion of this project. I also thank
to my parents for their motivation and support. I
must thank to my classmates as well. Last but
not least; I would like to thank all those who
had supported me directly and indirectly in any
manner for completion of this project.

PAWAN KUMAR XII-A


ABOUT THE PROJECT
This project is designed to add a new
employees, update salary or details of
existing employees, delete details; it is
also capable of searching an employee
details and the most useful thing is that it
will also enter the data in Microsoft excel.

This project is made by SQL DBMS and


Python connectivity using
“mysql.connector” module and excel
connectivity. The module “sys” is used to
provide access to some variables used or
maintained by the interpreter and to
functions that interact strongly with
interpreter.
CODING
print('----------------------------------------------------
\nWELCOME TO MANAGEMENT SYSTEM OF ABC
COMPANY\n----------------------------------------------\n ')
print('
*******************************************\
nFROME HEAR YOU CAN MANAGE YOUR EMPLOYEES
DATA\n*************************************
*******\n')
defmoh():
importmysql.connector as cont
mydb=
cont.connect(host="localhost",user="root",passwd="
root",database="business")
mycur=mydb.cursor()
print("\n")
print ('YOUR CURRENT TABLE IS :\n ')
iv="SELECT* FROM EMPLOYES"
mycur.execute(iv)
et=mycur.fetchall()
for K in et:
print(K)
print("\n WHAT YOU WANT TO DO\n ")
print(' A: ADMISSION OF NEW EMPLOYEE : ')
print(' B: UPDATE EMPLOYEES AMOUNT OF
SALARY')
print(' C: DELETE EMPLOYEES DETAILS')
print(' D: DO YOU WANT TO EXIT')
print(' E: SEARCH FOR EMPLOYEE')
print('\n ')
c=input("Enter Your Choice (A-E) : ")
if c=='A' or c=='a':
print('=============================\nGIVE
DETAILS OF NEW
EMPLOYEE\n=============================')
q= int(input("ENTER EMPLOYEE 4 DIGIT CODE : "
))
x= input("ENTER THE NAME OF NEW EMPLOYEE
:" )
y= input("ENTER THE GENDER OF EMPLOYEE
MALE(M) , FEMALE (F) : " )
z= input("ENTER SALARY OF EMPLOYEE : " )
sql="insert into employes (ecode, ename, sex, salary)
values(%s,%s,%s,%s)"
val=(q,x,y,z)
mycur.execute(sql,val)
print('*************************\nNEW
EMPLOYEE ADDED \n*************************')
hiv="SELECT* FROM EMPLOYES"
mycur.execute(hiv)
ret=mycur.fetchall()
for l in ret:
print(l)
mydb.commit()
elif c=='B' or c=='b':
n=input("WRITE UPDATED SALARY : ")
o=input("WHAT IS THE CODE OF EMPLOYEE : ")
ql="UPDATE employes SET salary=%s WHERE ecode
=%s"\
%(n,o)
mycur.execute(ql)
hiv="SELECT* FROM EMPLOYES"
mycur.execute(hiv)
ret=mycur.fetchall()
for l in ret:
print(l)
mydb.commit()
elif c=='C' or c=='c':
zzx= input(' NAME THE EMPLOYEE CODE WHOSE
DATA YOU WANT TO DELETE : ')
zx="DELETE FROM EMPLOYES WHERE ecode =
%s"%(zzx)
mycur.execute(zx)
hiv="SELECT* FROM EMPLOYES"
mycur.execute(hiv)
ret=mycur.fetchall()
for l in ret:
print(l)
mydb.commit()
elif c== 'd' or c== 'D':
exit()
elif c=='E'or c=='e':
print(" 1: TO SERACH BY EMPLOYEE CODE
NUMBER")
print(" 2: TO SEARCH BY EMPLOYEE NAME")
c=int(input("ENTER YOUR CHOICE : "))
if c==1:
try:
roll=int(input("ENTER EMPLOYEE CODE NUMBER TO
SEARCH : "))
qry="select * from employes where ecode=%d"%roll
mycur.execute(qry)
data=mycur.fetchall()
iflen(data)==0:
print('\n')
print("EMPLOYEE NOT FOUND")
print('\n')
fori in data:
j=str(i).split()
for k in j:
print(k,end=" ")
print()
except:
print("SORRY NO EMPLOYEE IS FOUND RELATED TO
THIS NAME")
if c==2:
try:
name=input("ENTER EMPLOYEE NAME TO SEARCH :
")
qry="select * from employes where
ename='%s'"%name
mycur.execute(qry)
data=mycur.fetchall()
iflen(data)==0:
print('\n')
print("EMPLOYEE NOT FOUND")
print('\n')

fori in data:
j=str(i).split()
for k in j:
print(k,end=" ")
print()
except:
print("SORRY NO EMPLOYEE IS FOUND RELATED TO
THIS NAME")

else:
print('-------------------------------\nPLEASE ENTER FROM
ABOVE OPTIONS\n-------------------------------')
ra = input("DO YOU WANT TO CONTINU IF YES(Y) ,
NO(N): ")
ifra== 'y' or ra== 'Y':
moh()
else:
exit()

moh()
OUTPUT
BIBLIOGRAPHY
 Computer Science with
Sumita Arora
 Computer Science with Preeti
Arora
 www.wikipedia.org

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy