0% found this document useful (0 votes)
81 views

Computer Science With Python Project For Class 12 Cbse Invert

Cs project

Uploaded by

Ashu Panchal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
81 views

Computer Science With Python Project For Class 12 Cbse Invert

Cs project

Uploaded by

Ashu Panchal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 36
Subedh Public School Nii cS A Project Report on Employee Management Submitted By Under the Guidance of 1. Kratika Mittal Mr. Sunil Nehra 2. Manish Suryakant Jain PGT (Computer Science) 3. Mohit Chandel CERTIFICATE This is to certify that Kratika Mittal, Manish Suryakant Jain and Mohit Chandel of Class XII A, has successfully completed the investigatory project on the topic Employee Management under the guidance of Mr. Sunil Nehra (PGT, Computer Science) during the academic year 2019-20 in the partial fulfillment of AISSCE Practical Examination conducted by CBSE. Signature of Signature of Signature of Internal Examiner External Examiner Candidate DECLARATION I hereby declare that the project work entitled "Employee Management” submitted to Department of Computer Science, Subodh Public School, Jaipur is prepared by us. All the coding is result of my personal efforts. 1. Kratika Mittal - X11 A 2. Manish Suryakant Jain - XII A 3, Mohit Chandel - XII A ACKNOWLEDGEMENT I would like to express a deep sense of thanks and gratitude to my projectguide Mr. Sunil Nehra Sir for guiding me immensely through the course of the project. He alwaysevinced keen interest in my work, His constructive advice and constant motivation have been responsible for the successful completion of this project. My sincere thanks goes to Dr Bela Joshi, our Principal Madam, for her coordination in extending every possible support for completion of this project. | also thanks to my parents for their motivation and support. I must thanks to my classmates for their timely help and support for compilation of this project. Last but not least, | would like to those who had helped directly or indirectly towards the completion of this project. 1. Kratika Mittal — XII A 2. Manish Suryakant Jain - XI] A 3. Mohit Chandel — XILA . Introduction . Imported files and used functions in Python . Table Created in MySQL . Coding Output Scenes . Limitations and Enhancement Bibliography INTRODUCTION The project is designed to keep records of Employee in specific department and specific post who are working in these companies. A table named cred in MySQL5.0 to store information about user login ids and passwords. One more table named department in MySQLS.0 to store information about department code, name and their packages. One more table named post in My$QLS5.0 to store information about post code and name. One more table named staff in MySQL5.0 to store information about employee (staff) name, address, phone number, salary and post. Administrator of the project can enter new record, display all/specific passenger record; he can modify and delete records in any table. . Import MYSQL for database connectivity Funcilous Caen Pink . connect()- For Database and tables creation . cursor()- To execute MySQL queries. . fetchall ()- To fetch all the rows. . commit()- To execute (commit) current transaction. . fetchone ()- To fetch row according to query. Table: cred mysql> desc cred; Field | Type Wu | Key user_n PRI passid varchar(5e) | NO varchar(5@) | YES 2 rows in set (8.01 sec) varchar(se) varchar(s@) varchar(58) varchar(50) varchar(5@) varchar(50) Table: department Field deptecde deptname deptpackage | vi departaent: Type | mutt | key varchae(s@) | (Na PRI char(se) | YES 1 varchar(e) | YES | i rows in set (0.00 sec) Table: post post: rows in set (6.01 Type varchar(se) varchar(5@) Ant (a) sec) Default | CODING import mysq|.connector as my while yu=: print("---1-FOR LOGiN—-") print("---2-FOR SIGNUP—") pritt("0- EX" a6=input("ENTER:") uname=input(" ENTER USERNAME:-") pswd=input(" ENTER PASSWORD:-") con=my.conhect(host="loralliost", uset="root", passwid="manager",databas ") cur=con-cursor() clir.ekecute| "select passwd,userin fromered where user n=""sunames""") row=ctir.fetchall() for Finrow: ifr{0]==pswe: print("Sucessfully Login!") cur.close{) [department's employee management functions! fo="n" while fo==" print(!*" ---1-Employee Details—- --“2-Department Functions --3-Post Details— --4-Update Or Deléte LoginiD And Password--- --0-LOGOQUT---"") a=input(" ENTER:-") ifa=="1": IMemployee details functions!!! Asta! while fis="n"; print("") print("---1-All Staff Details-—") print("--2-Search Employee By E_1D---") print("---3-Change Employee Details--") print("---4-Add New Employee— print(-5-Delete Employee Details-—") print{"---0-Exit Staff Functions-—") al=input("ENTER:-") Mall detaits tit ifal==' ‘con=my.connect(host="localhost",user="root", passwd="manager",database="empmanage cur=con.cursor() cur.execute("select * from staff”) foriiin-cur: print(i) con.close() Wsearcher!!! localhost” user="root",passwe="manager" database="empmanage curscon.cursor() cunexecute(''select “from staff where s_id="'seid+" xecurfetchonel) if K==None: print("tnvalidl dt") else: cur-execute("select * fromstaff where seide"™") foriincur: print(i) con:close() y=input|"'Search Another Id(y/n):-") lehanger!t! if al=" con=my.connect(host="lacalhost", user="root",passwd="manager”,database="empmanage i) cur=conicursor() eid=input("Enter Employee ) cur.execute("select *from staffwheres_id="+eid+""') xectirfetchonel) ifx==None: print("Inwalidita!") else: print(""" —=i-Change name -+:2-Change Contact-—- ---3-Change Address--- ~-74-Change Salary" a 0=input("ENTER=") ifalo=s"4"; agzinput("Enter New Name:-") con=my.connect(host="localhost" user="root",passwd="manager", database="empmanage ) curscon.cursor() cur.execute("update staff set s_name=""+aq+'" where Side" 4eid#'"") con.comimit() cohiclose() print("Record Updated!") ifalo="2"; ageinput('"Enter New Contact:-") con=my.connect(host="localhost" user="root',passwd="manager",database="empmanage 4 cur=con.cursor() clir.exteute(" update statfset s_phone="+aq+ "where s_id="+eid+"™") con.commit() con.close() print(''Record Updated") ifa10=2'3": anzinput{"Enter New Address:-") con=my.connect(host="tocalhost',user="root'",passwd=""manager’,database-"empmanage ") eiur=conn.cursor() ‘curexecute("update staff set s_“addr=""+aq+'" where s_id="seide"") con.commit{) ‘con.close() print("Record Updated|") if alo=="4": ag=input("Enter New Salary:-") con=my.connect(hast="localhost" user="root",passwd="manager",database="empmanage ") curscon.cursor() cur-execute("update staff set s_salaty="4ay" where side eid) con.commit() coniclose() print("Récord Updated") Mradderil! if al==" nid=input ("Enter 1D:-") nna=input("Enter name:-") nad=input("Entéraddress:-") Hap=input{"Enter Contact:-") hsa=input("Enter Salary:-") nposinput("Enter post:") con=my.connect(host="loralhost" user="root” passwd="manager", database="empmanage S) cur=con,cursor() curexecute("select s: id from staffwheres_id="4nids"") x=cur fetchone() if x==None and len(nap)<=11: Glirexecutel'insertinto stat values("sstr(nid)+")""4nnae"/,"“enad";"4nap+ /ansat™,"“snpot" )") con.commit() con.closa() print(""Details Savedi") else: print("D Already Exists Or Invalid Contact!") fllremover!tt ifat aw-input("Enter Employee 1D:-") can=my, connect(host="local host" user="raot",passwd="manager" database="empmanage 4 ctir=con,cursor{) cur.execute("select * from staffwhere s_id=""taw+t'") xeturfetchonél) ifx==None: print("Invalid Id!") else: curexecute( delete fromstaffwheres_id="" con.commit() con.close() print("Record Removed!") print('Staff Functions Closed") INDepartment Functions!!! ifaete fi="n" while f1=="n"': print(’"" --1-See Department— --2-Search Department--- —-3-Add Department—- ~-4-Remove Department— —5-Upadate Department— ~«.0-Exit Department Functions--'") a2=input("ENTER:”) Ulsee Department!!! ifaz==' con=my.connect(host="tocalhost",user="root",passwd="manager", database="emnpmanage ) cur=con.cursor() cur.execute("select *from department”) for iin cur: print{i) {search item!!! if a2: aasty" While ad=="y" or ad=s"¥"s con=my.connect(host="localhost",user="root",passwd="manager" ,database="empmanage 7); cur=con.cursor() asinput("Enter Department Code:-") clinexecutel’'select “from department where deptcode="4at"") xecurfetchonel) ifk==None: print("Invalid [d!") else: cir execute(" select * fromi department whére déptcode="+at"") foriincur: print(i) ad=input(''Search Other Department(y/n):-") {{1Add Department!!! if a2: adery" while ad=="y" oF ad== ico=input("Enter Department code:-"), ina=input("Enter Department Name:-") ipa=int(input(“ Enter Department package: ‘con=my, connect(host="localhost" user="root",passwd="manager" database="empmanage i) curscon.cursor() clinvexecute(’Select “from department where deptcode="41c0+ xecuirfetchall() if ==None; print("Try Again!) else: cur.execute("insertintodepartment values(#icoH","-+1hae", "4strlipa}t"") print{'SucesstullyAdded!") conicommit() con:close() ad=input("Add Other Department(y/n):-") print{("Department code Already Exists!") iiremovertit ifad==" ade"y" while ad=="y" or ad== con=my.connect{host="lacal host’ user="root",passwd="manager”,database="empmanage cur=con.cursor() azinput("Enter Department Cone:-") cur.execute('select “from department where deptcode=""+a+"") x=cur.fetchone() ifk=2None: print("Invalid {e!") else: cuit.execute("delete from department where deptcode=""4at! ‘con.commit() con:close() ad=input(''Remove Other Departmently/t print("Deleted Sucessfully!") Wlupdateritt if az==" ad=ty" whilead=="y" or ad== print(™" ~--1-Change Department Name-— ~72:Change Departmenit Package---” isinptit("ENTER: iff exty" while e=="y" ore=="¥": arinput("Enter Department Code;-") nasinput(“Entér New Name:-") con=my.connect(host="localhost",user="root”,passwd="manager" database="empmanage ") cuir=con.cursorl) cur.execute(''seléct * fromdepartment where deptcode="*a+"") x=tuir-fetctone() ifi==None: print("Invalidtd!") else: cliéxecuté( "Update department set deptname2"+nat" where con.commit{) con dlose(| e=input("Change Any Other Namely/n):-") azinput('Enter Department Codi na=int{input("Enter New package:-"}} con=my.connect(host="localhost",user="root",passwd="manager" database ="empmanage mf cur=con.cursér() curexecute("'selact *fromdepartment where deptcode="4a#"") x=cur.fetchoné() ifx==None: print("Invalicttd!") else: cur.execute"update department setdeptname="4nat'" where 4a") con.commit() con.close() e-fiput("Chahge Any Other Package(y/n):-") print("Record Updated!") ad=input("Change Any Other Recard(y/n): if'aa: fi="y" print("Department Closed!") Hpost fuhetions!! ifa=="3": qp="n" while gp=="n": print(”™” —i-See List Of Post-— —-2:Undate Post— --J-Remove OF Add Past— -+0-Exit Post Functions —""") a3sinput("ENTER:") IForlist seeing!!! if ad==' consmy.connect(hast='localhost’, user="root", passwd="manager")database="empmanage” ) cuir=con.curser() Clit, execute("select * from post") foriin’cur: print(i) con,close() {!Updatert!! if a3 con=my.connect(host=localhost’ user" root", passwd="manager" database="empmanage" ) cur=con.cursor{) i¢=input("Enter Post Code:-") curvexecute('select * from past where post_catte=""tic#" xecur.fetchone() if k==None: print("Invalid Code!") else: upg=int(input("Enter New No_Of_Emplayees:-")) cur-execute("update post set no_of_employees=""+str{upg)+" where Mice") ‘con:coniknitt) coniclose() print("Post Updated!") er=input("Change Any Other Past(y/n):-") remover and adderi!! print("""—1-Add New Post— ~~-2-Remove Post-— rtysinput("ENTER:-") ifrty=="2" df'y* while di==")" oraf=="¥": ton=my.connect(hast='localhost’,user="rapt", passwd=""manager" database="empmanage” ) cur=con.cursor() ite=input("Enter Post Code:-") ith=input("Enter Post Name:-") itq=input('Enter No_Of_Employees:-") cur.execute("‘setect post code frampast where post_cades"+itct" xecuir-fetctiall() ifx==None: cUrexecute("insertinto post valuies(#ites™,""4itne", "4itqe'")") con.commit() con.close() print("Post Added!") else: print ("Post Code Already Exists!") dfeinput(AddAny Other Post(y/n)::") ifrty=="2": op="y" while op=="y" or op=="Y": itc-input("Enter Post Cade:-") con=my.connect(host="localhost',user="root", passwd="manager’ database="empmianage” ) cur=coh curser) curexectite("select post_code fram post where post_code="+ite+” x=cur.fetchone() ifx==None: print("invalid Post Codet") else: cur.execute("delate from post where post code=""4ite#"") cot. commitl) ‘¢on.close() print("PostRemoved!") op=input("“Remove Any Other Post(y/n| uisinput(“Add Or Remove Any Other Post(y/n| if a3==' apety" print("Posts Closed!") Iloginidor Password update or delete programme!!! ifa=="4"s Tke"n" while Ike="n" orl ke="N": print’ ---1- For UpdatingLoginid Or Password-— ~2-For Remove AnID-— print| =11-Update Loginib-= —2-Upilate Password---""1) rtsinput(“ENTER:+") if rtaca nm="y" while nm=="y" or nm=="¥": con=my.connect(host='localhost’ user="root", passwd=""manager’ database="empmanage” ) cur=con.cursor() bid =input("Enter Old LoginiD:") hid=input(" Enter New LoginID:-") cur.execute(''select *fromcred where user_n=""+oid+"") x=eur.fetchone() ifx==None: print("Id Does not Exists!") else: curnexecute("Update cred set user_n="4nid+" where con.commit() con.close() print("LoginiO Updated!) nmeinputl'Change Any Other LoginID(y/n):-") while nm=="y" or nm=="¥": con=my.connect(host='localhost’user="root", passwd=""manager" database="empmanage" ) cur=con.cursor() oid=input("Enter Loginib:-") nid=input("Enter New Password:-") cur,execute("'selact * from cred where user, x=cur.fetchana() ifx==None: print("Id Does not Exists!") else: cur.execute("update cretiset passwd="#nid+"! where user_n="4oid+"")

You might also like