0% found this document useful (0 votes)
18 views25 pages

Emp MGMT

Mari

Uploaded by

roasterthakur9
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)
18 views25 pages

Emp MGMT

Mari

Uploaded by

roasterthakur9
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/ 25

Shri Ganesh Higher Secondary School

Amaha,Sidhi,(M.P.)

Informatics Practices Project


On Flight Management System

SUBMITTED BY: SUMITTED TO:


…………………….. Ashok Kumar Saket

Class: XII’ A PGT (CS)


CBSE Roll no: …………………………
CERTIFICATE
This is to certify that ………………………. of class: XII A of Shri
Ganesh Higher Secondary Scholl Amaha,Sidhi,(M.P.) has done
his project on FLIGHT MANAGEMENT SYSTEM under my
supervision. He has taken interest and has shown at most
sincerity in completion of this project.

I certify this project up to my expectation


& as per guidelines issued by CBSE, NEW DELHI.

Internal Examiner External Examiner

Principal
ACKNOWLEDGMENT
It is with pleasure that I acknowledge my
sincere gratitude to our teacher, Ashok Kumar
Saket who taught and undertook the
responsibility of teaching the subject computer
science. I have been greatly benefited from his
classes.
I am especially indebted to our Principal
Dr.Mahendra Tiwari who has always been a
source of encouragement and support and
without whose inspiration this project would
not have been a successful I would like to place
on record heartfelt thanks to him.
Finally, I would like to express my sincere
appreciation for all the other students for my
batch their friendship &the fine time that we
all shared together
Employee Management
__________________________________________________________________________________

HARDWARE AND SOFTWARE REQUIRED

HARDWARE

1. PC
2. MOBILE PHONE

SOFTWARE
• PYTHON (latest version)
• MYSQL
• PYTHON CONNECTOR

INFORMATICS PRACTICES
SQL:

__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

IDLE:
1. Show all the records

2. Add records

3. Search record

__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

i. ID

ii. NAME

iii. DEPARTMENT

iv. GENDER

__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

v. HIRE DATE

vi. SALARY

4. Delete record

__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

5. Graphical Representation

i. EMPLOYEES DEPARTMENT

Input:

Output:

2. Gender Graph

__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

i. INPUT

ii. OUTPUT

6. Update record

__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

i. ID

ii. NAME

iii. DEPARTMENT

iv. GENDER

__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

v. HIRE DATE

vi. SALARY

7. EXIT

__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

CODE:
ans="y"

__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

def empgr():
print("1. emloyees department \n2. gender graph")
x=int(input("enter the no:"))
if x==1:
deptgraph()
elif x==2:
sexgraph()
elif x!=[1,2]:
print("INVAILD INPUT")
def deptgraph():
import pymysql
import matplotlib.pyplot as plt
d1=pymysql.connect(host="localhost",user="root",passwd="",database="office")
c1=d1.cursor()
quer="select count(*) from emp where dept='hr';"
c1.execute(quer)
x=c1.fetchone()
lst=list(x)
quer="select count(*) from emp where dept='manageing';"
c1.execute(quer)
y=c1.fetchone()
lst1=list(y)
quer="select count(*) from emp where dept='sales';"
c1.execute(quer)
z=c1.fetchone()
lst2=list(z)
quer="select count(*) from emp where dept='accounts';"
c1.execute(quer)
a=c1.fetchone()
lst3=list(a)
quer="select count(*) from emp where dept='production';"
c1.execute(quer)
d1.commit()
a=c1.fetchone()
lst4=list(a)
lstt=lst+lst1+lst2+lst3+lst4
y=["HR","Manageing","Sales","Accounts","Production"]
plt.bar(y,lstt,width=0.50)
plt.xlabel("Department")
plt.ylabel("No. of employees")
plt.show()
def sexgraph():
import pymysql
import matplotlib.pyplot as plt
d1=pymysql.connect(host="localhost",user="root",passwd="",database="office")
c1=d1.cursor()
quer="select count(*) from emp where gender='male';"
__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

c1.execute(quer)
x=c1.fetchone()
lst=list(x)
quer="select count(*) from emp where gender='female';"
c1.execute(quer)
y=c1.fetchone()
lst1=list(y)
lstt=lst+lst1
y=["Male","Female"]
plt.bar(y,lstt,width=0.25)
plt.xlabel("Sex")
plt.ylabel("no. of teachers")
plt.show()
def showallrecords():
import pymysql
import pandas as pd
d1=pymysql.connect(host="localhost",user="root",passwd="",database="office")
c1=d1.cursor()
quer="select empid from emp;"
c1.execute(quer)
rec=c1.fetchall()
lst=[]
for t in rec:
for x in t:
lst.append(x)
quer1="select empname from emp;"
c1.execute(quer1)
rec1=c1.fetchall()
lst1=[]
for t in rec1:
for x in t:
lst1.append(x)
quer2="select dept from emp;"
c1.execute(quer2)
rec2=c1.fetchall()
lst2=[]
for t in rec2:
for x in t:
lst2.append(x)
quer3="select gender from emp;"
c1.execute(quer3)
rec3=c1.fetchall()
lst3=[]
for t in rec3:
for x in t:
lst3.append(x)
quer4="select hire_date from emp;"
__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

c1.execute(quer4)
rec4=c1.fetchall()
lst4=[]
for t in rec4:
for x in t:
lst4.append(x)
quer5="select sal from emp;"
c1.execute(quer5)
rec5=c1.fetchall()
lst5=[]
for t in rec5:
for x in t:
lst5.append(x)
data={"id":lst,"name":lst1,"dept":lst2,"gender":lst3,"hire date":lst4,"salary":lst5}
df=pd.DataFrame(data)
print(df)
def addrecords():
import pymysql
d1=pymysql.connect(host="localhost",user="root",passwd="",database="office")
c1=d1.cursor()
print("")
print("DEPARTMENT: \n1. hr=$30000 \n2. manageing=$40000 \n3. sales=$50000 \n4.
accounts=$60000 \n5. production=$70000")
print("")
ans1="yes"
while ans1=="yes":
x=int(input("Enter the id:"))
quer1="select * from emp where empid=%d;" %x
c1.execute(quer1)
if c1.rowcount>0:
print("duplicate record")
elif c1.rowcount==0:
ans1="no"
y=input("Enter the name:")
a=input("Enter the dept:")
b=input("Enter the gender:")
c=input("Enter the hire date:")
if a=="hr":
v=30000
elif a=="manageing":
v=40000
elif a=="sales":
v=50000
elif a=="accounts":
v=60000
elif a=="production":
v=70000
__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

quer="Insert into emp values(%d,'%s','%s','%s','%s',%d);" %(x,y,a,b,c,v)


c1.execute(quer)
d1.commit()
print("Record Added")
f=input("Want to see the added record:")
if f=="y":
quer="select * from emp where empid=%d;"%x
c1.execute(quer)
rec=c1.fetchone()
tid,name,dept,gender,hiredate,sal=rec
print("id= %d"%tid,"name= %s"%name,"department= %s"%dept,"gender= %s"%gender,"hire
date= %s"%hiredate,"salary= %d"%sal,sep="\n")
else:
print("Thank You")
def search():
import pymysql
import pandas as pd
d1=pymysql.connect(user="root",host="localhost",passwd="",database="office")
c1=d1.cursor()
print("1. Id \n2. Name \n3. Department \n4. Gender \n5. Hire Date \n6. Salary")
cho=int(input("enter the no."))
if cho==1:
x=int(input("enter the id:"))
quer="select empid from emp where empid='%d';" %x
c1.execute(quer)
row=c1.fetchall()
lst=[]
for z in row:
for y in z:
lst.append(y)
quer1="select empname from emp where empid='%d';" %x
c1.execute(quer1)
row1=c1.fetchall()
lst1=[]
for z in row1:
for y in z:
lst1.append(y)
quer2="select dept from emp where empid='%d';" %x
c1.execute(quer2)
row2=c1.fetchall()
lst2=[]
for z in row2:
for y in z:
lst2.append(y)
quer3="select gender from emp where empid='%d';" %x
c1.execute(quer3)
row3=c1.fetchall()
__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

lst3=[]
for z in row3:
for y in z:
lst3.append(y)
quer4="select hire_date from emp where empid='%d';" %x
c1.execute(quer4)
row4=c1.fetchall()
lst4=[]
for z in row4:
for y in z:
lst4.append(y)

quer5="select sal from emp where empid='%d';" %x


c1.execute(quer5)
row5=c1.fetchall()
lst5=[]
for z in row5:
for y in z:
lst5.append(y)
ndf=pd.DataFrame({"Empid":lst,"Empname":lst1,"Department":lst2,"Gender":lst3,"Hire
date":lst4,"Salary":lst5},index=[0])
print(ndf)
elif cho==2:
x=input("enter the name.")
quer="select empid from emp where empname='%s';" %x
c1.execute(quer)
row=c1.fetchall()
lst=[]
for z in row:
for y in z:
lst.append(y)
quer1="select empname from emp where empname='%s';" %x
c1.execute(quer1)
row1=c1.fetchall()
lst1=[]
for z in row1:
for y in z:
lst1.append(y)
quer2="select dept from emp where empname='%s';" %x
c1.execute(quer2)
row2=c1.fetchall()
lst2=[]
for z in row2:
for y in z:
lst2.append(y)
quer3="select gender from emp where empname='%s';" %x
c1.execute(quer3)
__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

row3=c1.fetchall()
lst3=[]
for z in row3:
for y in z:
lst3.append(y)
quer4="select hire_date from emp where empname='%s';" %x
c1.execute(quer4)
row4=c1.fetchall()
lst4=[]
for z in row4:
for y in z:
lst4.append(y)
quer5="select sal from emp where empname='%s';" %x
c1.execute(quer5)
row5=c1.fetchall()
lst5=[]
for z in row5:
for y in z:
lst5.append(y)
ndf=pd.DataFrame({"Empid":lst,"Empname":lst1,"Department":lst2,"Gender":lst3,"Hire
date":lst4,"Salary":lst5})
print(ndf)
elif cho==3:
x=input("enter the dept:")
quer="select empid from emp where dept='%s';" %x
c1.execute(quer)
row=c1.fetchall()
lst=[]
for z in row:
for y in z:
lst.append(y)
quer1="select empname from emp where dept='%s';" %x
c1.execute(quer1)
row1=c1.fetchall()
lst1=[]
for z in row1:
for y in z:
lst1.append(y)
quer2="select dept from emp where dept='%s';" %x
c1.execute(quer2)
row2=c1.fetchall()
lst2=[]
for z in row2:
for y in z:
lst2.append(y)
quer3="select gender from emp where dept='%s';" %x
c1.execute(quer3)
__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

row3=c1.fetchall()
lst3=[]
for z in row3:
for y in z:
lst3.append(y)
quer4="select hire_date from emp where dept='%s';" %x
c1.execute(quer4)
row4=c1.fetchall()
lst4=[]
for z in row4:
for y in z:
lst4.append(y)
quer5="select sal from emp where dept='%s';" %x
c1.execute(quer5)
row5=c1.fetchall()
lst5=[]
for z in row5:
for y in z:
lst5.append(y)
ndf=pd.DataFrame({"Empid":lst,"Empname":lst1,"Department":lst2,"Gender":lst3,"Hire
date":lst4,"Salary":lst5})
print(ndf)
elif cho==4:
x=input("enter the gender:")
quer="select empid from emp where gender='%s';" %x
c1.execute(quer)
row=c1.fetchall()
lst=[]
for z in row:
for y in z:
lst.append(y)
quer1="select empname from emp where gender='%s';" %x
c1.execute(quer1)
row1=c1.fetchall()
lst1=[]
for z in row1:
for y in z:
lst1.append(y)
quer2="select dept from emp where gender='%s';" %x
c1.execute(quer2)
row2=c1.fetchall()
lst2=[]
for z in row2:
for y in z:
lst2.append(y)
quer3="select gender from emp where gender='%s';" %x
c1.execute(quer3)
__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

row3=c1.fetchall()
lst3=[]
for z in row3:
for y in z:
lst3.append(y)
quer4="select hire_date from emp where gender='%s';" %x
c1.execute(quer4)
row4=c1.fetchall()
lst4=[]
for z in row4:
for y in z:
lst4.append(y)
quer5="select sal from emp where gender='%s';" %x
c1.execute(quer5)
row5=c1.fetchall()
lst5=[]
for z in row5:
for y in z:
lst5.append(y)
ndf=pd.DataFrame({"Empid":lst,"Empname":lst1,"Department":lst2,"Gender":lst3,"Hire
date":lst4,"Salary":lst5})
print(ndf)
elif cho==5:
x=input("enter the hire date:")
quer="select empid from emp where hire_date='%s';" %x
c1.execute(quer)
row=c1.fetchall()
lst=[]
for z in row:
for y in z:
lst.append(y)
quer1="select empname from emp where hire_date='%s';" %x
c1.execute(quer1)
row1=c1.fetchall()
lst1=[]
for z in row1:
for y in z:
lst1.append(y)
quer2="select dept from emp where hire_date='%s';" %x
c1.execute(quer2)
row2=c1.fetchall()
lst2=[]
for z in row2:
for y in z:
lst2.append(y)
quer3="select gender from emp where hire_date='%s';" %x
c1.execute(quer3)
__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

row3=c1.fetchall()
lst3=[]
for z in row3:
for y in z:
lst3.append(y)
quer4="select hire_date from emp where hire_date='%s';" %x
c1.execute(quer4)
row4=c1.fetchall()
lst4=[]
for z in row4:
for y in z:
lst4.append(y)
quer5="select sal from emp where hire_date='%s';" %x
c1.execute(quer5)
row5=c1.fetchall()
lst5=[]
for z in row5:
for y in z:
lst5.append(y)
ndf=pd.DataFrame({"Empid":lst,"Empname":lst1,"Department":lst2,"Gender":lst3,"Hire
date":lst4,"Salary":lst5})
print(ndf)
elif cho==6:
x=int(input("enter the salary:"))
quer="select empid from emp where sal='%d';" %x
c1.execute(quer)
row=c1.fetchall()
lst=[]
for z in row:
for y in z:
lst.append(y)
quer1="select empname from emp where sal='%d';" %x
c1.execute(quer1)
row1=c1.fetchall()
lst1=[]
for z in row1:
for y in z:
lst1.append(y)
quer2="select dept from emp where sal='%d';" %x
c1.execute(quer2)
row2=c1.fetchall()
lst2=[]
for z in row2:
for y in z:
lst2.append(y)
quer3="select gender from emp where sal='%d';" %x
c1.execute(quer3)
__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

row3=c1.fetchall()
lst3=[]
for z in row3:
for y in z:
lst3.append(y)
quer4="select hire_date from emp where sal='%d';" %x
c1.execute(quer4)
row4=c1.fetchall()
lst4=[]
for z in row4:
for y in z:
lst4.append(y)
quer5="select sal from emp where sal='%d';" %x
c1.execute(quer5)
row5=c1.fetchall()
lst5=[]
for z in row5:
for y in z:
lst5.append(y)
ndf=pd.DataFrame({"Empid":lst,"Empname":lst1,"Department":lst2,"Gender":lst3,"Hire
date":lst4,"Salary":lst5})
print(ndf)
def delete():
import pymysql
d1=pymysql.connect(host="localhost",user="root",passwd="",database="office")
c1=d1.cursor()
x=int(input("enter the id:"))
quer="delete from emp where empid=%d;" %x
rowcount=c1.execute(quer)
if rowcount>0:
d1.commit()
print("Record Deleted")
else:
print("NO RECORD FOUND")
def changerecord():
import pymysql
import pandas as pd
pd.set_option('display.expand_frame_repr',False)
d1=pymysql.connect(user="root",host="localhost",passwd="",database="office")
c1=d1.cursor()
tid=int(input("enter the id:"))
quer="select * from emp where empid=%d" % tid
c1.execute(quer)
if c1.rowcount>0:
row=list(c1.fetchone())
print('')

__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

df=pd.DataFrame({"id":row[0],"name":row[1],"department":row[2],"gender":row[3],"hiredate":ro
w[4],"salary":row[5]},index=[1])
print(df)
print("\n1. id \n2. name \n3. department \n4. gender \n5. hire date \n6. salary")
cr=int(input("enter the no:"))
if cr==1:
ans1='yes'
while ans1=="yes":
y=int(input("enter the id:"))
quer1="select * from emp where empid=%d" %y
c1.execute(quer1)
if c1.rowcount>0:
print("DUPLICATE RECORD")
elif c1.rowcount==0:
ans1="no"
quer="update emp set empid=%d where empid=%d" %(y,tid)
c1.execute(quer)
d1.commit()
print("RECORD CHANGED")
elif cr==2:
y=input("enter the name:")
quer="update emp set empname='%s' where empid=%d" %(y,tid)
c1.execute(quer)
d1.commit()
print("RECORD CHANGED")
elif cr==3:
y=input("enter the department:")
quer="update emp set dept='%s' where empid=%d" %(y,tid)
c1.execute(quer)
d1.commit()
print("RECORD CHANGED")
elif cr==4:
y=input("enter the gender:")
quer="update emp set gender='%s' where empid=%d" %(y,tid)
c1.execute(quer)
d1.commit()
print("RECORD CHANGED")
elif cr==5:
y=input("enter the hire date:")
quer="update emp set hire_date='%s' where empid=%d" %(y,tid)
c1.execute(quer)
d1.commit()
print("RECORD CHANGED")
elif cr==6:
y=int(input("enter the salary:"))
quer="update emp set sal=%d where empid=%d" %(y,tid)
__________________________________________________________________________________
IP Project
Employee Management
__________________________________________________________________________________

c1.execute(quer)
d1.commit()
print("RECORD CHANGED")
elif cr!=[1,2,3,4,5,6,7]:
print("INVAILD INPUT")
elif c1.rowcount==0:
print("NO RECORD FOUND TO CHANGE")
while ans=="y":
print("")
print("1. show all the records \n2. add records \n3. search records \n4. delete record \n5.
Graphical representation \n6. Change values of records")
x=int(input("Enter the choice of no:"))
if x==1:
showallrecords()
elif x==2:
addrecords()
elif x==3:
search()
elif x==4:
delete()
elif x==5:
empgr()
elif x==6:
changerecord()
elif x!=[1,2,3,4,5]:
print("\t\tINVAILD INPUT")
ans=input("want to continue:")

__________________________________________________________________________________
IP Project

You might also like