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

DOC Modify

Uploaded by

kumarsahil82096
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

DOC Modify

Uploaded by

kumarsahil82096
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Sarvodaya Bal Vidyalaya

BT Block Shalimar Bagh


PROJECT ON
EMPLOYEE MANAGEMENT SYSTEM

XII - B
Roll No. -:

SUBMITTED BY: SUBMITTED TO:


SHIVAM KUMAR DR.MITALI BANSAL
INDEX

S. NO TITLE PAGES
1. Main Characteristics of EMPLOYEE 3
MANAGEMENT SYSTEM

2. System Requirements 4

3. Python 5-6

4. MySQL 7-9

5. Source code 10-32

6. Output 33-34
Bonafide Certificate
This is a bonafide record of the project done by Sahil kumar
Employee Management System Submitted in partial fulfillment
of the requirement for the practical Examination for the XII - A
in the academic year of 2024-2025

INTERNALEXAMINER EXTERNALEXAMINER
ACKNOWLEDGMENT
We would like to express our special thanks of gratitude to our
teacher Dr. MITALI BANSAL as well as our
principal Mr. VIKRAM YADAV who gave us the golden
opportunity to do this wonderful project on the topic Employee
Management System which also help us in doing a lot of
research and came to know about so many new things we are
really thankful to them.
Secondly we would also like to thank our gods, parents and
friends who helped us a lot in finalizing this project within the
limited time framed.
SYSTEM REQUIREMENT
HARDWARE REQUIREMENT:

• Processor: Intel(R),Pentium®N3540,@2.16GHz
• Memory(RAM):4.00GB
• Hard Disk:1TB

Software requirement:

• Python language:IDLE(Python3.7)
• Database connector:MySQL

• OperatingSystem:windows7,
Andriod 10
PYTHON
• Python is an interpreted, object-oriented, high- level programming
language with dynamic semantics.
• Its high-level built in data structures, combined with dynamic typing
and dynamic binding, make it very attractive for Rapid Application
Development, as well as for use as a scripting or glue language to
connect existing components together.

PYTHON INSTALLATION PROCESS:

Step 1: Download the Python 3 Installer


1. Open a browser window and navigate to the Download page for
Windowsatpython.org.
2. Underneath the heading at the top that says Python Releases for
Windows, click on the link for the Latest Python 3 Release - Python 3.x.x.
(As of this writing, the latest is Python3.6.5.)
3. Scroll to the bottom and select either Windows x86-64 executable installer
for64-bit or Windows x86 executable installer for 32-bit.

Step 2: Run the Installer

Once you have chosen and downloaded an installer, simply run it by double-
clicking on the downloaded file. A dialog should appear that looks something
like this:
Mysql

• MySQL is an Oracle-backed open source relational database


management system (RDBMS) based on Structured Query Language
(SQL).
• MySQL runs on virtually all platforms, including Linux,UNIX and
Windows.

MySQL installation process:

Step 1: download MySQL


Download MySQL from dev.mysql.com/downloads/. Follow MySQL Community
Server, Windows and download the “Without installer” version.

Step 2: extract the files


We will install MySQL to C:mysql, so extract the ZIP to your C: drive and rename
the folder from “mysql- x.x.xx-win32” to “mysql”. MySQL can be installed
anywhere on your system. If you want a lightweight installation, you can remove
every sub-folder except for bin, data, scripts and share.

Step 3: create a configuration file


My SQL provides several configuration methods but, in general, it is
easiest to create a my.ini file in the mysql folder.

Step 4: test your installation


The MySQL server is started by running C:mysql bin mysqld.exe. Open a
command box (Start> Run > cmd).This will start the MySQL server which
listens for requests on local host port 3306. You can now start the MySQL
command line tool and connect to the database.
Step 5: change the root password
The MySQL root user is an all-powerful account that

can create and destroy databases. If you are on a shared network,


it is advisable to change the default (blank) password.
Step 6: Install MySQL as a Windows service
The easiest way to start MySQL is to add it as a Windows service. Open the
Control Panel, Administrative Tools, than Services and double-click MySQL. Set
the Startup type to “Automatic” to ensure MySQL starts every time you boot your
PC.
SOURCE CODE
import mysql.connector

def selection():
db=mysql.connector.connect(user='root',password='12345',host='localhost',database='length')
cursor= db.cursor()
print('.........................\nWELCOME TO OFFICE MANAGEMENT SYSTEM\n ')
print("1.EMPLOYEE MANAGEMENT")
print("2.SALARY MANAGEMENT")
ch=int(input("\nEnter ur choice (1-2) : "))
if ch==1:
print('\nWELCOME TO EMPLOYEE MANAGEMENT SYSTEM\n')
print('a.NEW EMPLOYEE')
print('b.UPDATE STAFF DETAILS')
print('c.DELETE DETAILS')
c=input("Enter ur choice (a-c) : ")
print('\nInitially the details are..\n')
display1()
if c=='a':
insert1()
print('\nModified details are..\n')
display1()
elif c=='b':
update1()
print('\nModified details are..\n')
display1()
elif c=='c':
delete1()
print('\nModified details are..\n')
display1()
else:
print('Enter correct choice !!')
elif ch==2:
print('\nWELCOME TO SALARY MANAGEMENT SYSTEM\n')
print('a.NEW SALARY')
print('b.UPDATE SALARY DETAILS')
print('c.DELETE DETAILS')
c=input("Enter ur choice (a-c) : ")
print('\nInitially the details are..\n')
display2()
if c=='a':
insert2()
print('\nModified details are..\n')
display2()
elif c=='b':
update2()
print('\nModified details are..\n')
display2()
elif c=='c':
delete2()
print('\nModified details are..\n')
display2()
else:
print('Enter correct choice !!')
def insert1():
empno=int(input("Enter Employee No : "))
ename=input("Enter Employee Name : ")
job=input("Enter Designation: ")
hiredate=input("Enter date of joining : ")
db=mysql.connector.connect(user='root',password='12345',host='localhost',database='length')
print('bob')
cursor = db.cursor()
print('cob')
cursor.execute('insert into emp values(%s,%s,%s,%s)',(empno,ename,job,hiredate))
print('yes')
print()
db.commit()
print('hot')
print()
db.close()

def display1():
try:
db=mysql.connector.connect(user='root', password='12345',host='localhost',database='length')
cursor = db.cursor()
ijk = "SELECT * FROM emp"
cursor.execute(ijk)
results= cursor.fetchall()
for c in results:
empno=c[0]
ename=c[1]
job=c[2]
hiredate=c[3]
print("(empno=%d,ename=%s,job=%s,hiredate=%s)" % (empno,ename,job,hiredate)
except:
print ("Error: unable to fetch data")
db.close()

def update1():
db=mysql.connector.connect(user='root',password='12345',host='localhost',database='length')
print(db)
cursor=db.cursor()
print(cursor)
etc= " SELECT * FROM emp"
cursor.execute(etc)
results= cursor.fetchall()
for c in results:
empno=c[0]
ename=c[1]
job=c[2]
hiredate=c[3]
tempst=int(input("Enter Employee No : "))
temp=input ("Enter new Designation: ")

try:
etc= "Update emp set job=%s where empno='%d'" % (temp,tempst)
cursor.execute(etc)
db.commit()
except Exception as e:
print (e)
db.close()

def delete1():
try:
db=mysql.connector.connect(user='root', password='12345',host='localhost',database='last')
print(db)
cursor= db.cursor()
print(cursor)
rts= "SELECT * FROM emp"
cursor.execute(rts)
results = cursor.fetchall()
for c in results:
empno=c[0]
ename=c[1]
job=c[2]
hiredate=c[3]
except:
print ("Error: unable to fetch data")
temp=int(input("\nEnter emp no to be deleted : "))
try:
ghi= " delete from emp where empno='%d'" % (temp)
ans=input("Are you sure you want delete the record(y/n) : ")
if ans=='y' or ans=='Y':
cursor.execute(ghi)
db.commit()
except Exception as e:
print(e)
db.close()
def insert2():
empno=int(input("Enter Employee No : "))
hiredate=input("Enter date of salary : ")
salary=int(input("Enter salary: "))
db=mysql.connector.connect(user='root',password='12345',host='localhost',database='length')
print('bob')
cursor = db.cursor()
print('cob')
cursor.execute('insert into salary values(%s,%s,%s)',(empno,hiredate,salary))
print('yes')
print()
db.commit()
print('hot')
print()
db.close()
def display2():
try:
db=mysql.connector.connect(user='root',password='12345',host='localhost',database='length')
cursor = db.cursor()
ijk = "SELECT * FROM salary"
cursor.execute(ijk)
results= cursor.fetchall()
for c in results:
empno=c[0]
hiredate=c[1]
salary=c[2]
print("(empno=%d,hiredate=%s,salary=%d)" % (empno,hiredate,salary))
except:
print ("Error: unable to fetch data")
db.close()

def update2():
db=mysql.connector.connect(user='root',password='12345',host='localhost',database='length')
print(db)
cursor=db.cursor()
print(cursor)
etc= " SELECT * FROM salary"
cursor.execute(etc)
results= cursor.fetchall()
for c in results:
empno=c[0]
hiredate=c[1]
salary=c[2]
tempst=int(input("Enter Employee No : "))
temp=input ("Enter new salary: ")
try:
etc= "Update salary set salary=%s where empno='%d'" % (temp,tempst)
cursor.execute(etc)
db.commit()
except Exception as e:
print (e)
db.close()

def delete2():
try:
db=mysql.connector.connect(user='root',password='12345',host='localhost',database='length')
print(db)
cursor= db.cursor()
print(cursor)
rts= "SELECT * FROM salary"
cursor.execute(rts)
results = cursor.fetchall()
for c in results:
empno=c[0]
hiredate=c[1]
salary=c[2]
except:
print ("Error: unable to fetch data")
temp=int(input("\nEnter salary no to be deleted : "))
try:
ghi= " delete from salary where empno='%d'" % (temp)
ans=input("Are you sure you want delete the record(y/n) : ")
if ans=='y' or ans=='Y':
cursor.execute(ghi)
db.commit()
except Exception as e:
print(e)
db.close()
selection()
The Employee Management

DBMS: MySQL
Host: localhost
User: root
Password: 12345
DataBase: length
Table Structure: As per the Screenshot

Given below: Table: Employee

Table:Salary
OUTPUT:
EMPLOYEE DETAILS
1.INSERT DETAILS
2.UPDATE DETAILS
3.DELETE DETAILS
SALARY DETAILS

1.INSERT DETAILS
2.UPDATE DETAILS
3.DELETE DETAILS
Thanking
Thank you for spending your precious time for the Project

"Employee Management System” Thanking you

You might also like