You are on page 1of 35

TABLE OF CONTENTS

ACKNOWLEDGEMENT
CERTIFICATE
REQIUREMENTS
CODING
OUTPUT
LIMITATIONS
FEATURES
BIBLIOGRAPHY
ACKNOWLEDGEMENT

I WOULD LIKE TO EXTEND MY SINCERE


AND CORDIAL THANKS TO MY “COMPUTER
SCIENCE” TEACHER MRS PRIYANKA FOR
HER GUIDANCE AND SUPPORT.I ALSO
THANK MY “PRINCIPAL” MR. ANIL KUMAR.
FINALLY I WOULD LIKE TO THANK CBSE
FOR GIVING ME THIS GOLDEN
OPPORTUNITY TO UNDERTAKE THIS
PROJECT.
Certificate

This is to verify that MAHAK RATHEE of


class XII, Chandan Bal Vikas Public
School, have completed her project in
Computer Practicals for the AISSCE as
prescribed by CBSE in the year 2022-23

DATE: ___________
ROLL NO. :___________

SIGNATURE OF SIGNATURE OF
INTERNAL EXAMINER: EXTERNAL EXAMINER:
___________________ ___________________
REQUIREMENTS

HARDWARE REQUIRED
➢PRINTER- TO PRINT THE REQUIRED
DOCUMENTS OF THE PROJECT
➢PROCESSOR- PENTINUM III
➢RAM- 4GB
➢HARD DISK- 20 GB

SOFTWARE REQUIRED
➢ OPERATING SYSTEM:WINDOW 10
➢ PYTHON IDLE 3.8,FOR
EXECUTION OF PROGRAM
➢ MS WORD FOR PRESENTATION
OF OUTPUT
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 MySQL5.0 to store
information about department code, name and their packages.
One more table named post in MySQL5.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.
Files Imported in Project

1. Import MYSQL for database connectivity

Functions Used in Project

1. connect()- For Database and tables creation

2. cursor()- To execute MySQL queries.

3. fetchall ()- To fetch all the rows.

4. commit()- To execute (commit) current transaction.

5. fetchone ()- To fetch row according to query.


Tables Created in MySOL

Table: cred

Table: staff
Table: department

Table: post
CODE:-
import mysql.connector as my

f0="n"

while f0=="n":

print("--1-FOR LOGIN-"

print("--2-FOR SIGNUP")

print("--0-EXIT")

a6=input("ENTER:-")

if a6="1":

uname=input("ENTER USERNAME:-")

pswd=input("ENTER PASSWORD:-")

con=my.connect(host="localhost",user="root",passwd="manager";database="emp
manage ")

cur-con.cursor()

cur.execute("select passwd,user_n from cred where user n="uname+""")

row=cur.fetchall()

for r in row:

ifr[0]=pswd:

print("Sucessfully Login!")

cur.close()

#!!!department's employee management functions!!!


manishjain598

while fo=="n":

print("""

---1-Employee Details...

---2-Department Functions→→→

---3-Post Details--

-4-Update Or Delete LoginID And Password-

---0-LOGOUT--")

a=input("ENTER:-"))

if a=="1":

# !!!employee details functions!!!

f1 ="n"

while f1=="n":

print(***)

print("--1-All Staff Details---")

print("--2-Search Employee By E_ID")

print("-Change Employee Details--")

print("---4-Add New Employee---")

print("---5-Delete Employee Details--")

print("...0-Exit Staff Functions-")

a1=input("ENTER:-"}

# !!!all details!!!

if al="1":
con=my.connect(host="localhost",user="root",passwd="manager",
database="empmanage")

cur-con.cursor()

cur.execute("select * from staff")

for i in cur:

print(1)

con.close()

#. !!!searcher!!!

if al=="2":

y="y"

while y=="y":

eid=input("Enter Employee ID:-")

con-my.connect(host="localhost",user="root",passwd="manager"
database="empmanage ")

curacon.cursor()

cur.execute("select * from staff where s_id="+el+"'"')

x=cur.fetchone()

if x=None:

print("invalid id!")

else:

cur.execute("select "from staff where s_id="+eid+"

for i in cur:

print(i)

con.close()

y=input("Search Another Id(y/n):-")


# !!!changer!!!

if al="3":

con-

my.connect(host="localhost",user="root",passwd="manager",database="empman
age")

cur=con.cursor()

eid=input("Enter Employee ID:-")

cur.execute("select * from staff where s_id="+eid+"

x=cur.fetchone[]

if x==None:

print("Invalid id!")

else:

print("""

---1-Change name---

---2-Change Contact---

--3-Change Address-

---4-Change Salary--""")

a10=input("ENTER:-")

if a10="1":

aq=input("Enter New Name:-")

con-my.connect(host="localhost",user
"root",passwd="manager",database="empmanage")

cur=con.cursor()

cur.execute("update staff sets_name=+ag+" where


s_id="+eid+""")

con.commit()
con.close()

print("Record Updated!")

if a10="2":

aq=input("Enter New Contact:-")

con=my.connect(host="localhost",user="root",passwd="manager",

database="empmanage")

cur=con.cursor()

cur.execute("update staff sets phone="+aq+"where s_id="+eid+""")

con.commit()

con.close()

print("Record Updated!")

if a10="3":

aq=input("Enter New Address:-")

con-my.connect(host-"localhost",user-
"root",passwd="manager",database="empmanage

cur=con.cursor()

cur.execute("update staff sets_addr="age" wheres id="+elds""")

con.commit()

con.close()

print("Record Updated!")

if a10="4":

aq=input("Enter New Salary:-")

con-my.connect(host="localhost",user="root",passwd="manager",
database="empmanage")
cur-con.cursor()

cur.execute("update staff sets salary="+aq+"" where


s_id=""+eid+""")

con.commit()

con.close()

print("Record Updated!")

# !!!ladder!!!

if al="4":

nid=input("Enter ID:>")

nna=input("Enter name:-")

nad=input("Enter address:-")

nap=input("Enter Contact:>"}

nsa=input("Enter Salary:-")

npa=input("Enter post:-")

con-my.connect(host "localhost",user
"root",passwd="manager",database="empmanage")

cur=con.cursor()

cur.execute("selects_id from staff wheres_id=""+id)

x=cur.fetchone()

if x=None and len(nap)<=11:

cur.execute("insert into staff


values("estr(nid)+"+na+nad++nap+":"+na+"/"+npo+""")

con.commit()

con.close()

print("Details Saved!")

else:
print("ID Already Exists Or Invalid Contact!")

# !!!remover!!!

if al="5":

aw=input("Enter Employee ID:-")

con=my.connect(host="localhost",user="root",passwd="manager",database="emp
manage")

cur-con.cursor()

cur.execute("select * from staff wheres_id="+aw+"”")

x=cur.fetchone()

if x=None:

print("Invalid Id!")

else:

cur.execute("delete from staff wheres_id="+aw+")

con.commit()

con.close()

print("Record Removed!")

if a1="0":

f1="y"

print("Staff Functions Closed!")

# !!!Department Functions!!!

if a=="2":

f1="n"

while fl="n":

print("""
---1-See Department--

---2-Search Department---

---3-Add Department-

-4-Remove Department-

---5-Upadate Department-

---0-Exit Department Functions""")

a2-input("ENTER:-''')

# !!!see Department!!!

if a2=="1":

con=my.connect(host "localhost",user
"root",passwd="manager",database="empmanage")

cur=con.cursor()

cur.execute("select * from department")

for i in cur:

print(i)

# !!!search item!!!

if a2="2":

ad="y"

while ad="y" or ad="y":

con=my.connect(host="localhost",user="root",passwd="manager",database="emp
manage")

cur-con.cursor()

as=input("Enter Department Code:="")

cur.execute("select * from department where deptcode="+a+!!!)


x=cur.fetchone()

if x=None:

print("Invalid Id!")

else:

cur.execute("select * from department where deptcode="++)

for i in cur:

print(i)

ad-input("Search Other Department(y/n):-")

# !!!Add Department!!!

if a2="3":

ad="y"

while ad="y" or ad="Y":

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

cur=con.cursor()

cur.execute("select from department where deptcodes"+ico+")

x=cur.fetchall()

if x==None:

print( ")

else:

cur.execute("insert into department values("+ico+na+","str{ipa)+"]")

print("Sucessfully Added!")
con.commit()

con.close()

ad-input("Add Other Department(y/n):-)

print("Department code Already Exists!")

# !!!remover!!!

if a2="4":

ad="y"

while ad="y" or ad=="Y":

con=my.connect(host="localhost",user

"root",passwd="manager",database="empmanage")

curacon.cursor()

a=input("Enter Department Code:-")

cur.execute("select * from department where deptcode=""*+*+*"*"*)

x=cur.fetchone()

if x==None:

print("Invalid Id!")

else:

cur.execute("delete from department where deptcode="+a+")

con.commit()

con.close()

ad=input("Remove Other Department(y/n):-"}

print("Deleted Sucessfully!")

# !!!updater!!!
if a2="5":

ad="y""

while ad="y" or ad="Y":

print("""

---1-Change Department Name--

---2-Change Department Package--")

i=input("ENTER:-"

if i=="1":

e="y"

while e="y" or e="Y":

as=input("Enter Department Code:-")

na-input("Enter New Name:-")

con=my.connect(host="localhost",user="root",passwd="manager",database="emp
manage")

curacon.cursor()

cur.execute("select * from department where deptcode="+a+m)

x=cur.fetchone()

if x===None:

print("Invalid id!")

else:

cur.execute("update department set deptname="+na+" where


deptcode="""+a+""")

con.commit()

con.close()

e=input("Change Any Other Name(y/n):-")


If i=="2":

e="y"

while e=="y" or e=="y":

a =input("Enter Department Code:-")

na=int(input("Enter New package:-"))

con=my.connect(host="localhost",user="root",passwd="manager",database="emp
manage")

cur-con.cursor()

cur.execute("select * from department where deptcode="+a+""")

x-cur.fetchone()

if x==None:

print("Invalid id!")

else:

cur.execute("update department set deptname="+na+" where


deptcode=""+na+""")

con.commit()

con.close()

e=input("Change Any Other Package(y/n):+")

print("Record Updated!")

ad-input("Change Any Other Record(y/n):-")

if a2="0":

f1="y"

print("Department Closed!")

# !!!post functions!!!
if a =="3":

qp="n"

while qp=="n":

print("""

---1-See List Of Post---

---2-Update Post---

--3-Remove Or Add Post---

---0-Exit Post Functions)

a3-input("ENTER: ")

# !!!For list seeing!!!

if a3="1":

con-my.connect(host="localhost",user="root",passwd="manager",
database="empmanage")

cur-con.cursor()

cur.execute("select * from post")

for i in cur:

print(i)

con.close()

# !!!Updater!!!

if a3="2":

er="y"

while erly" or er="y":

con=my.connect(host="localhost,user="root",passwd="manager",
database="empmanage")
cur=con.cursor()

ic= input("Enter Post Code:-")

cur.execute("select * from post where post_code=""+ic+"""")

x=cur.fetchone()

if x=None:

print("Invalid Code!")

else:

upq=int(input("Enter New No Of Employees:"))

cur.execute("update post set no of employees="+str[upq)+" where


post_code=""+ic+"""")

con.commit()

con.close()

print("Post Updated!")

er= input("Change Any Other Post(y/n):-")

# !!!remover and adder!!!

if a3=="3":

ui="y"

while ui="" or ui="Y":

print("I-Add New Post-

---2-Remove Post-”)

rty=input("ENTER:-")

if rty=="1":

df="y"

while df="y" or df="Y":


con-my.connect(host="localhost",user="root",passwd="manager",
database="empmanage")

cur-con.cursor()

itc=input("Enter Post Code:-")

itn=input("Enter Post Name:-")

itq= input("Enter No_Of_Employees:-")

cur.execute("select post code from post where post_code="+itc+""")

x=cur.fetchall()

if x==None:

cur.execute("insert into post values("+itc+", ""+itn+","+itq+""")

con.commit()

con.close()

print("Post Added!")

else:

print("Post Code Already Exists!")

df=input("Add Any Other Post(y/n):-")

op="y"

while op="y" or op="Y":

itc=input("Enter Post Code:-")

con=my.connect(host=localhost,user="root",passwd="manager",
database="empmanage")

curecon.cursor()

cur.execute("select post code from post where post_code="+itc+""")

x=cur.fetchone()

if x==None:

print("Invalid Post Code!")


else:

cur.execute("delete from post where post_code="+itc+""")

con.commit()

con.close()

print("Post Removed!")

op=input("Remove Any Other Post(y/n);")

ui=input("Add Or Remove Any Other Post(y/n):-")

if a3="0":

ap="y"

print("Posts Closed!")

# !!!loginid or Password update or delete programme!!!

if a=="4":

ik="n"

while ik="n" or Ik="N":

print("""

---1-For Updating Loginld Or Password---

---2-For Remove An ID---

---0-For Exit---""")

jkl-input("ENTER:-")

if jkl="1":

ty="y"

while ty="y":

print("""

---1-Update LoginID---

---2-Update Password---""")
rt=input("ENTER:-")

if rt=="1"

nm="y"

while nm=="y" or am=="Y":

con=my.connect(host=localhost",user="root",passwd="manager"
database="empmanage")

cur=con.cursor()

old input("Enter Old LoginID:-")

nid=input("Enter New LoginID:-")

cur.execute("select "from cred where user_n=""+old+""")

x=cur.fetchone()

if x=None:

print("Id Does not Exists!")

else:

cur.execute("update cred set user_n="+nid+" where

user_n="+oid+""")

con.commit()

con.close()

print("LoginID Updated!")

nm-input("Change Any Other LoginID(y/n):-")

if rt=="2"

nm="y"

while nm=="y" or nm=="Y":

con-my.connect(host 'localhost,user "root",passwd="manager",


database="empmanage")

curscon.cursor()
old-input("Enter LoginID:-")

nid-input("Enter New Password:-")

cur.execute("select * from cred where user_n="+old+""")

x=cur.fetchone()

if x===None:

print("Id Does not Exists!")

else:

cur.execute("update cred set passwd="+nid+" where user_n="+old+""")

con.commit()

con.close()

print("Password Updated!")

nm=input("Change Any Other Password(y/n):-")

ty=input("Change Any Other Login Or Password(y/n):-")

if jkl="2":

nm="y"

while nme="y" or nm=="y";

con=my.connect(host="localhost,user="root",passwd="manager",
database="empmanage")

curacon.cursor()

oid=input("Enter LoginID:-")

cur.execute("select" from cred where user_=”n+old+"")

x-cur.fetchone()

if x==None:

print("Id Does not Exists!")

else:

cur.execute("delete from cred where user_n=""+old+"")


con.commit() con.close()

print("LoginID Removed!")

nm=input("Change Any Other Credential(y/n):-")

if jkl=="0":

ik="y"

print("Sucessfully Exit!")

if a=="0":

f0="y"

print("Sucessfully LOGOUT!")

else:

print("Invalid Login Id or Password!")

print("Try Again!!")

# !!!Signup Function!!!

if a6=="2":

y="y"

while y="y" or y="y":

us=input("Enter New Username:-")

ps=input("Enter New Password:-")

con=my.connect(host="localhost",user="root",passwd="manager",database="emp
manage")

cur=con.cursor()

cur.execute("select * from cred where user_n=""+us+""")

x=cur.fetchone()

if x==None:

cur.execute("insert into cred values("use","apse"))


print("Sucessfully Saved!")

con.commit()

con.close()

else:

print("UserID Already Exists!")

y=input("Create Other New id(y/n):-")

# !!!Programme Closer!!!

if a6=="0":

yu="y"

print("Programme Closed!")
OUTPUT:

Main Records ,Employee Details, Inert Record, Show Particular


Record ,Delete Record , Department Record ,Post Record,Delete
Record,Update Record.
FEATURES
THE PROJECT NAMED EMPLOYEE MANAGEMENT IS
BENEFICIA FOR MANAGING RECORDS OF
EMPLOYEES .
VARIOUS OPERATIONS CAN BE PERFORMED USING
THIS SYSTEM. YOU CAN DO THE FOLLOWING
OPERATIONS:
• HELPFUL IN MANAGING RECORDS
• USER FRIENDLY
• EASY TO UPDATE
Bibliography

THE FOLLOWING BOOK WERE USED IN


THE COMPLETION OF THIS PROJECT :
❖ COMPUTER SCIENCE BY
SUMITRA ARORA

You might also like