EMPLOYEE MANAGEMENT SYSTEM CS Group Project
EMPLOYEE MANAGEMENT SYSTEM CS Group Project
CLASS-XII
INDEX
1. Acknowledgement
2. Certificate of Authenticity
3. Introduction
4. Header Files
5. Requirements
6. Screenshots
7. Python Codes
8. Bibliography
Acknowledgement
This project was made by PANKAJ SINGH, PRIYA VERMA,
PRASHANT MISHRA, and SAKET MISHRA of Class 12th and we
would like to express our sincere gratitude to our Computer
Science teacher Mr. Pankaj Shukla for his vital support ,guidance
and encouragement without which this project would not have
come forth.
We would also like to express our gratitude to the school and to
the Principal, Ms. Swati S Shaligram for being a constant support
in completion of this project. We would also like to thank our
friends and classmates for encouraging us during the course of
this project. Finally, we would like to thank CBSE for giving us this
wonderful opportunity to undertake this project.
Certificate of Authenticity
This is to certify that
PANKAJ SINGH, PRIYA VERMA, PRASHANT MISHRA, and
SAKET MISHRA
Of Class 12 have prepared the report on the project
entitled
“EMPLOYEE MANAGEMENT SYSTEM”
The report is the result of their collaborative efforts &
endeavors. The report is found worthy of acceptance as
final project report for the subject
Computer Science Python (083)
Of Class XII. They have prepared the report under my
guidance and supervision in the academic year 2022-23, as
per CBSE guidelines.
System Requirements:
Python 3.8.0 (64 bit)
Modern Operating System:
Windows 7 or 10
x86 64-bit CPU (Intel / AMD architecture)
4 GB RAM
5 GB free disk space
--------- Table Designs--------
Table Name: emp_info
Field Names:
1. Emp_id
2. First_Name
3. Last_Name
4. Father_Spouse_Name
5. Date_of_Birth
6. GraduateUG_PG
7. dept_id
8. RegularY_N
9. Designation
10. email
11. contact_num
12. Joining_Date
13. Aadhar_num
14. Address
15. Grade
#database
def data_base():
try:
mycursor.execute("create database emp_manage")
print("Database Created Successfully")
except Exception as e:
print("Database Error!!!,You have given error -- ",e)
print("Please try again")
data_base()
#department table
def dept_table():
try:
mycursor.execute("use emp_manage")
mycursor.execute('''create table emp_dept
(dept_id varchar(5) primary key,
dept_name varchar(20),
dept_catgry varchar(20)
);
''')
print("Department table successfully created.")
except Exception as e:
print("Database Error",e)
print("Please try again")
dept_table()
def dept_data():
try:
mycursor.execute("use emp_manage")
mycursor.execute("insert into emp_dept values ('D001','Admin','Non-teaching');")
mycursor.execute("insert into emp_dept values ('D002','Medical','Non-teaching');")
mycursor.execute("insert into emp_dept values ('D003','Social Science','Teaching');")
mycursor.execute("insert into emp_dept values ('D004','Maths','Teaching');")
mycursor.execute("insert into emp_dept values ('D005','English','Teaching');")
mycursor.execute("insert into emp_dept values ('D006','Hindi','Teaching');")
mycursor.execute("insert into emp_dept values ('D007','Science','Teaching');")
mydb.commit()
except Exception as e:
print("Database Error:",e)
print("Please try again")
#salary table
def sal_table():
try:
mycursor.execute("use emp_manage")
mycursor.execute('''create table salary(Grade varchar(1) primary key,bas_sal int(6));''')
except Exception as e:
print("Database Error:",e)
print("Please try again")
def sal_data():
mycursor.execute("use emp_manage")
mycursor.execute("insert into salary values ('A',55000);")
mycursor.execute("insert into salary values ('B',45000);")
mycursor.execute("insert into salary values ('C',35000);")
mycursor.execute("insert into salary values ('D',20000);")
mydb.commit()
#employee table
def empinfo_table():
mycursor.execute("use emp_manage")
mycursor.execute('''create table emp_info(
Emp_Id varchar(5) primary key,
First_Name varchar(10),
Last_Name varchar(10),
Father_Spouse_Name varchar(20),
Date_of_Birth Date ,
GraduateUG_PG varchar(2),
dept_id varchar(5),
RegularY_N varchar(1),
Designation varchar(15),
email varchar(30),
contact_num BIGINT(10),
Joining_Date date,
Aadhar_num BIGINT(12),
Address varchar(50),
Grade varchar(1),
foreign key(dept_id) references emp_dept(dept_id),
foreign key(Grade) references salary(Grade));''')
def empinfo_data():
mycursor.execute("use emp_manage")
mycursor.execute('''insert into emp_info values ("E001"," Aakash"," Gupta", "Ram
Charan","1995-04-08", "PG", "D002", "Y", "Manager", "akg.gupta@gmail.com",8657474809,
"2020-10-10",234556678976,"Suraincha_Sidhauli_Sitapur","A");''')
mycursor.execute('''insert into emp_info values ("E002", "Aditya", "Tripathi",
"SambhuSaran","1996-05-07", "UG", "D004", "Y", "Engineer","tripathiad2@gmail.com",
2387201735, "2019-01-03", 271917291629, "Rampur_Bareily","B");''')
mycursor.execute('''insert into emp_info values ("E003", "Abhishek", "Tripathi", "
Manoj","1997-05-07", "UG", "D001", "N","Engineer","abtripathi276@gmail.com",7820162052,
"2010-01-01", 2816209172017," Reoli_LarRoad_Deoria","C");''')
mycursor.execute('''insert into emp_info values ("E004", "Vikas", "Dubey",
"Akhandanand","1998-04-03", "PG", "D003", "Y" , "Manager","dubeyvikas@gmail.com",
2386472928, "2019-03-19", 282926282528, "Fulera_Baliya","D");''')
mydb.commit()
# emp_info_deleted table.
def emp_info_deleted():
mycursor.execute("use emp_manage”))
mycursor.execute('''create table emp_infodeleted(
Emp_Id varchar(5) primary key,
First_Name varchar(10),
Last_Name varchar(10),
Father_Spouse_Name varchar(20),
Date_of_Birth Date ,
GraduateUG_PG varchar(2),
dept_id varchar(5),
RegularY_N varchar(1),
Designation varchar(15),
email varchar(30),
contact_num BIGINT(10),
Joining_Date date,
Aadhar_num BIGINT(12),
Address varchar(50),
Grade varchar(1),
foreign key(dept_id) references emp_dept(dept_id),
foreign key(Grade) references salary(Grade));''')
format(Emp_id,first_name,last_name,Father_Spouse_Name,Date_of_Birth,GradauteUG_PG,d
ept_id,regular,designation,email,
contact_num,Joining_Date, Aadhar_num, Address,grade))
mydb.commit()
choice = input("Do you want to add more employee (y/n)")
if choice in "Yy":
b=1
else:
b=2
press = input("Press Any key To Continue..")
maindata()
for i in r:
print("RECORD NO.",z)
print("\n")
print("Employee Id: ", i[0])
print("Employee First Name: ", i[1])
print("Employee Last Name: ", i[2])
print("Employee Father_Spouse_Name: ", i[3])
print("Employee Date_of_Birth : ", i[4])
print("Employee GraduateUG_PG : ", i[5])
print("Employee dept_id : ", i[6])
print("Employee RegularY_N: ", i[7])
print("Employee Designation: ", i[8])
print("Employee email: ", i[9])
print("Employee contact_num: ", i[10])
print("Employee Joining_Date: ", i[11])
print("Employee Aadhar_num: ", i[12])
print("Employee Address: ", i[13])
print("Employee Grade: ", i[14])
print("\n")
z+=1
press = input("Press Any key To Continue..")
maindata()
except Exception as e:
print("Database Eroor",e)
print("Please try again")
DIS_EMP()
maindata()
def SEA_DESIG():
try:
print("{:>60}".format("-->> Display Employee Record <<--"))
mycursor.execute("use emp_manage")
desig = input("Enter designation by whom you want to search ")
mycursor.execute("SELECT * FROM emp_info WHERE designation = '{}'".
format(desig))
s=mycursor.fetchall()
count=mycursor.rowcount
if count == 0:
print("NO RECORD FOUND....")
print("Please try again")
maindata()
else:
ac=1
for i in s:
print("RECORD NO.",ac)
print()
print("Employee Id: ", i[0])
print("Employee First Name: ", i[1])
print("Employee Last Name: ", i[2])
print("Employee Father_Spouse_Name: ", i[3])
except Exception as e:
print("Database Error:",e)
print("Please try again")
SEA_DESIG()
name = input("Enter First name of employee by whom you want to search ")
mycursor.execute("SELECT * FROM emp_info WHERE First_name = '{}'".
format(name))
t=mycursor.fetchall()
count=mycursor.rowcount
if count == 0:
print("NO RECORD FOUND....")
print("Please try again")
maindata()
else:
ab=1
for i in t:
print("RECORD NO.",ab)
print("\n")
print("Employee Id: ", i[0])
print("Employee First Name: ", i[1])
print("Employee Last Name: ", i[2])
print("Employee Father_Spouse_Name: ", i[3])
print("Employee Date_of_Birth : ", i[4])
except Exception as e:
print("Database Error:",e)
print("Please try again")
SEA_NAME()
press = input("Press Any key To Continue..")
maindata()
except Exception as e:
print("Database Error:",e)
print("Please try again")
SEA_EMPID()
press = input("Press Any key To Continue..")
maindata()
i=A[8]
j=A[9]
k=A[10]
l=A[11]
m=A[12]
n=A[13]
o=A[14]
mycursor.execute('''insert into emp_infodeleted values
('{}','{}','{}','{}','{}','{}','{}','{}','{}','{}',{},'{}',{},'{}','{}')'''.
format(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o))
mydb.commit()
def first_name():
try:
def last_name():
try:
x = input("Enter the updated last name of employee :")
mycursor.execute("use emp_manage")
mycursor.execute("UPDATE emp_info set last_name = '{}' where emp_id = '{}'".
format(x,y))
mydb.commit()
count=mycursor.rowcount
if count ==1:
print("Record Updated Successfully")
press = input("Press Any key To Continue..")
else:
print("Such Employee",y,"does not exist...")
print("Please try again")
last_name()
except Exception as e:
print("Database Error:",e)
print("Please try again")
last_name()
maindata()
def Father_Spouse_Name():
try:
x = input("Enter the updated father or spouse name of employee :")
mycursor.execute("use emp_manage")
mycursor.execute("UPDATE emp_info set Father_Spouse_Name = '{}' where
emp_id = '{}'". format(x,y))
mydb.commit()
count=mycursor.rowcount
if count ==1:
print("Record Updated Successfully")
def Date_of_Birth():
try:
print("Database Error:",e)
print("Please try again")
Date_of_Birth()
maindata()
def GradauteUG_PG():
try:
x = input("Enter the updated Graduated UG or PG of employee :")
mycursor.execute("use emp_manage")
mycursor.execute("UPDATE emp_info set GraduateUG_PG = '{}' where emp_id = '{}'
". format(x,y))
mydb.commit()
count=mycursor.rowcount
if count ==1:
def regular():
try:
x = input("Enter the updated Regularity Y/N of employee :")
mycursor.execute("use emp_manage")
mycursor.execute("UPDATE emp_info set RegularY_N = '{}' where emp_id = '{}'".
format(x,y))
mydb.commit()
count=mycursor.rowcount
if count ==1:
print("Record Updated Successfully")
press = input("Press Any key To Continue..")
else:
print("Such Employee",y,"does not exist...")
print("Please try again")
regular()
except Exception as e:
print("Database Error:",e)
print("Please try again")
regular()
maindata()
def designation():
try:
x = input("Enter the updated designation of employee :")
mycursor.execute("use emp_manage")
mycursor.execute("UPDATE emp_info set designation = '{}' where emp_id = '{}'".
format(x,y))
mydb.commit()
count=mycursor.rowcount
if count ==1:
print("Record Updated Successfully")
press = input("Press Any key To Continue..")
else:
print("Such Employee",y,"does not exist...")
print("Please try again")
designation()
except Exception as e:
print("Database Error:",e)
print("Please try again")
designation()
maindata()
def email():
try:
def emailValid():
import re
regex = re.compile(r'([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]
{2,})+')
x = input("Enter the updated email of employee :")
if re.fullmatch(regex, x):
return x
else:
print("You have entered a wrong format")
print("Please try again")
emailValid()
x = emailValid()
mycursor.execute("use emp_manage")
mycursor.execute("UPDATE emp_info set email = '{}' where emp_id = '{}'".
format(x,y))
mydb.commit()
count=mycursor.rowcount
if count ==1:
print("Record Updated Successfully")
press = input("Press Any key To Continue..")
else:
print("Such Employee",y,"does not exist...")
def contact_num():
try:
x = input("Enter the updated contact number of employee :")
mycursor.execute("use emp_manage")
mycursor.execute("UPDATE emp_info set contact_num = '{}' where emp_id = '{}'".
format(x,y))
mydb.commit()
count=mycursor.rowcount
if count ==1:
print("Record Updated Successfully")
press = input("Press Any key To Continue..")
else:
print("Such Employee",y,"does not exist...")
print("Please try again")
contct_num()
except Exception as e:
print("Database Error:",e)
print("Please try again")
contact_num()
maindata()
def Joining_Date():
try:
x = input("Enter the updated joining date of employee :")
mycursor.execute("use emp_manage")
mycursor.execute("UPDATE emp_info set Joining_Date = '{}' where emp_id = '{}'".
format(x,y))
mydb.commit()
count=mycursor.rowcount
if count ==1:
print("Record Updated Successfully")
press = input("Press Any key To Continue..")
else:
print("Such Employee",y,"does not exist...")
print("Please try again")
Joining_Date()
except Exception as e:
print("Database Error:",e)
print("Please try again")
Joining_Date()
maindata()
def Aadhar_num():
try:
x = input("Enter the updated aadhar number of employee :")
mycursor.execute("use emp_manage")
mycursor.execute("UPDATE emp_info set Aadhar_num = '{}' where emp_id = '{}'".
format(x,y))
mydb.commit()
count=mycursor.rowcount
if count ==1:
def Address():
try:
x = input("Enter the updated address of employee :")
mycursor.execute("use emp_manage")
mycursor.execute("UPDATE emp_info set Address = '{}' where emp_id = '{}'".
format(x,y))
mydb.commit()
count=mycursor.rowcount
if count ==1:
print("Record Updated Successfully")
press = input("Press Any key To Continue..")
else:
print("Such Employee",y,"does not exist...")
print("1.first_name","2.last_name","3.Father_Spouse_Name","4.Date_of_Birth","5.GradauteU
G_PG",
"6.regular","7.designation","8.email","9.contact_num","10.Joining_Date","11.Aadhar_num",
"12.Address",sep="\n")
x=int(input("Choose the number which you to modify "))
except Exception as e:
print("Database Error:",e)
MOD_EMP()
global y
y = emp_id
if x == 1:
first_name()
if x == 2:
last_name()
if x == 3:
Father_Spouse_Name()
if x == 4:
Date_of_Birth()
if x == 5:
GradauteUG_PG()
if x == 6:
regular()
if x == 7:
designation()
if x == 8:
email()
if x == 9:
contact_num()
if x == 10:
Joining_Date()
if x == 11:
Aadhar_num()
if x == 12:
Address()
else:
# Promote an Employee
def Promote_Emp():
print("{:>60}".format("-->> Promote Employee Record <<--\n"))
try:
y =input("Enter emp_id of employee which you want to modify ")
x = input("Enter the updated grade of employee : ")
mycursor.execute("use emp_manage")
mycursor.execute("UPDATE emp_info set Grade = '{}' where emp_id = '{}'".
format(x,y))
mydb.commit()
count=mycursor.rowcount
if count ==1:
print("Record Updated Successfully")
print("Employee Promoted")
press = input("Press Any key To Continue..")
else:
print("Such an employee doess't exist.Please try again.")
Promote_Emp()
maindata()
except Exception as e:
print("Database Error:",e)
maindata()
count1 = mycursor.rowcount
if count1 == -1:
print("NO RECORD FOUND....")
month=input("Please enter the month's name ")
print("==="*52)
print()
print("==="*52)
print("\n")
print("\n")
print("\n")
print("\n")
press = input("Press Any key To Continue..")
maindata()
except Exception as e:
print("Database Error:",e)
print("Please try again")
SAL_SLIP()
for i in r:
print("RECORD NO.",z)
print("\n")
print("Employee Id: ", i[0])
print("Employee First Name: ", i[1])
print("Employee Last Name: ", i[2])
print("Employee Father_Spouse_Name: ", i[3])
print("Employee Date_of_Birth : ", i[4])
print("Employee GraduateUG_PG : ", i[5])
print("Employee dept_id : ", i[6])
print("Employee RegularY_N: ", i[7])
print("Employee Designation: ", i[8])
print("Employee email: ", i[9])
def maindata():
while True:
print("\t\t\t\t\t\t\t " ,"*"*40 )
print("\t\t\t\t\t\t\t\t EMPLOYEE MANAGEMENT SYSTEM")
print("\t\t\t\t\t\t\t " ,"*"*40 )
print("========================================================================
===============================")
print("Please choose the desired option")
print()
print("========================================================================
=============================")
ch=int(input("Enter your choice(1 to 10):"))
print("========================================================================
=============================")
if (ch==1):
ADD_EMP()
if (ch==2):
DIS_EMP()
if (ch==3):
SEA_DESIG()
if (ch==4):
SEA_NAME()
if (ch==5):
SEA_EMPID()
if (ch==6):
DEL_EMP()
if (ch==7):
MOD_EMP()
if (ch==8):
SAL_SLIP()
if (ch==9):
Promote_Emp()
if (ch==10):
exit()
maindata()
BIBLIOGRAPHY
References taken from Sumitra Arora (Computer Science
Class XII & XI)