0% found this document useful (0 votes)
63 views34 pages

Employee Management System

Employee management computer science project
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)
63 views34 pages

Employee Management System

Employee management computer science project
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/ 34

A Project Report

On
EMPLOYEE MANAGEMENT
SYSTEM

For
AISSCE 2024 Examination
[As a part of the Computer Science Course
(083)]

Submitted By

Name:
Board Roll No:

Under the Guidance of:


RAJ KUMAR (PGT Computer Science)

VIVEK VIDYALAYA
JAMSHEDPUR
CERTIFICATE

This is to certify that the Project entitled Employee Management

System is a bonafide work done by Prem Tiwari of class XII

‘Science’ Session 2023-24 in partial fulfillment of CBSE AISSCE

Examination 2024 and has been carried out under my direct

supervision and guidance. This report or a similar report on the topic

has not been submitted for any other examination and does not form

a part of any other course undergone by the candidate.

…………………………………… ……………………………………
Signature of Student Signature of
Teacher/Guide

Board Roll No: …………….. Designation: PGT (Comp.


Sc.)

Place: Jamshedpur
Date:
ACKNOWLEDGMENT
I undertook this Project work, as the part of my XII-Computer
Science course. I had tried to apply my best of knowledge and
experience, gained during the study and class work experience.
However, developing software system is generally a quite
complex and time-consuming process. It requires a systematic
study, insight vision and professional approach during the
design and development. Moreover, the developer always feels
the need, the help and good wishes of the people near you,
who have considerable experience and idea.

I would like to extend my sincere thanks and gratitude to my


teacher Raj Kumar. I am very much thankful to our Principal
Mr. Awadhesh Singh for giving valuable time and moral
support to develop this software.

I would like to take the opportunity to extend my sincere


thanks and gratitude to my father Shri T. Vithoba Sakharam
and my mother Mrs. Sujata V. for being a source of
inspiration and providing time and freedom to develop this
software project.

I also feel indebted to my friends Sudarshan Pal and


Bhupendra Negi for the valuable suggestions during the
project work.

Prem
Tiwari
Class XII (Science)
CONTENT
1. Introduction

2. Theoretical Background

3. System Implementation

3.1 The Hardware used:

3.2 The Softwares used:

4. System Design & Development

4.1Database Design:

4.2 Menu Design:

5. User Manual

5.1 How to install:

5.2 Working with Software:

6. References
3.1 What is Database?
Introduction and Concepts:
A database is a collection of information related to a particular
subject or purpose, such as tracking customer orders or maintaining a
music collection. Using any RDBMS application software like MS SQL
Server, MySQL, Oracle, Sybase etc, you can manage all your
information from a single database file. Within the file, divide your
data into separate storage containers called tables. You may and
retrieve the data using queries.

A table is a collection of data about a specific topic, such as products


or suppliers. Using a separate table for each topic means you can
store that data only once, which makes your database more efficient
and reduces data-entry errors. Table organises data into columns
(called fields) and rows (called records).

A Primary key is one or more fields whose value or values uniquely


identify each record in a table. In a relationship, a primary key is used
to refer to specific record in one table from another table. A primary
key is called foreign key when it is referred to from another table.

To find and retrieve just the data that meets conditions you specify,
including data from multiple tables, create a query. A query can also
update or delete multiple records at the same time, and perform
built-in or custom calculations on your data.

Role of RDBMS Application Program:


A computer database works as a electronic filing system, which has a
large number of ways of cross-referencing, and this allows the user
many different ways in which to re-organize and retrieve data. A
database can handle business inventory, accounting and filing and
use the information in its files to prepare summaries, estimates and
other reports. The management of data in a database system is done
by means of a general-purpose software package called a Database
Management System (DBMS). Some commercially available DBMS are
MS SQL Server, MS ACCESS, INGRES, ORACLE, and Sybase. A
database management system, therefore, is a combination of
hardware and software that can be used to set up and monitor a
database, and can manage the updating and retrieval of database
that has been stored in it. Most of the database management
systems have the following capabilities:

 Creating of a table, addition, deletion, modification of records.

 Retrieving data collectively or selectively.

 The data stored can be sorted or indexed at the user's discretion


and direction.

 Various reports can be produced from the system. These may be


either standardized report or that may be specifically generated
according to specific user definition.

 Mathematical functions can be performed and the data stored in


the database can be manipulated with these functions to
perform the desired calculations.

 To maintain data integrity and database use.

The DBMS interprets and processes users' requests to retrieve


information from a database. In most cases, a query request will have
to penetrate several layers of software in the DBMS and operating
system before the physical database can be accessed. The DBMS
responds to a query by invoking the appropriate subprograms, each
of which performs its special function to interpret the query, or to
locate the desired data in the database and present it in the desired
order.

3.2 What is My SQL?


The management of data in a database system is done by means of a
general-purpose software package called a Database Management
System (DBMS). Some commercially available RDBMS are MS SQL
Server, MS ACCESS, INGRES, ORACLE, and Sybase.

MySQL, the most popular Open Source SQL database management


system, is developed, distributed, and supported by Oracle
Corporation. MySQL is named after co-founder Monty Widenius's
daughter, My. The name of the MySQL Dolphin (our logo) is “Sakila,”.

 MySQL is a database management system.


A database is a structured collection of data. It may be anything from a simple
shopping list to a picture gallery or the vast amounts of information in a
corporate network. To add, access, and process data stored in a computer
database, you need a database management system such as MySQL Server. Since
computers are very good at handling large amounts of data, database
management systems play a central role in computing, as standalone utilities, or
as parts of other applications.
 MySQL is based on SQL.
A relational database stores data in separate tables rather than putting all the data
in one big storeroom. This adds speed and flexibility. The SQL part of “MySQL”
stands for “Structured Query Language.” SQL is the most common standardized
language used to access databases and is defined by the ANSI/ISO SQL
Standard. The SQL standard has been evolving since 1986 and several versions
exist. In this manual, “SQL-92” refers to the standard released in 1992, “SQL:
1999” refers to the standard released in 1999, and “SQL:2003” refers to the
current version of the standard.
 MySQL software is Open Source.
Open Source means that it is possible for anyone to use and modify the software.
Anybody can download the MySQL software from the Internet and use it without
paying anything. If you wish, you may study the source code and change it to suit
your needs. The MySQL software uses the GPL (GNU General Public License),
 The MySQL Database Server is very fast, reliable, and easy to use.
If that is what you are looking for, you should give it a try. MySQL Server also
has a practical set of features developed in close cooperation with our users. You
can find a performance comparison of MySQL Server with other database
managers on our benchmark page. MySQL Server was originally developed to
handle large databases much faster than existing solutions and has been
successfully used in highly demanding production environments for several
years. Although under constant development, MySQL Server today offers a rich
and useful set of functions. Its connectivity, speed, and security make MySQL
Server highly suited for accessing databases on the Internet.
 MySQL Server works in client/server or embedded systems.
The MySQL Database Software is a client/server system that consists of a multi-
threaded SQL server that supports different backends, several different client
programs and libraries, administrative tools, and a wide range of application
programming interfaces (APIs).

The Main Features of MySQL

 Written in C and C++.

 Works on many different platforms.

 Uses multi-layered server design with independent modules.

 Provides transactional and non-transactional storage engines.

 Designed to make it relatively easy to add other storage


engines. This is useful if you want to provide an SQL interface for
an in-house database.

 Uses a very fast thread-based memory allocation system.

 Executes very fast joins using an optimized nested-loop join.

 Implements SQL functions using a highly optimized class library


that should be as fast as possible. Usually there is no memory
allocation at all after query initialization.

 Password security by encryption of all password traffic when you


connect to a server.

 Support for large databases. We use MySQL Server with


databases that contain 50 million records. We also know of users
who use MySQL Server with 200,000 tables and about
5,000,000,000 rows.
 MySQL client programs can be written in many languages. A
client library written in C is available for clients written in C or
C++, or for any language that provides C bindings.

 APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl are
available, enabling MySQL clients to be written in many
languages.

 The Connector/ODBC (MyODBC) interface provides MySQL


support for client programs that use ODBC (Open Database
Connectivity) connections.

 The Connector/J interface provides MySQL support for Java client


programs that use JDBC connections. Clients can be run on
Windows or UNIX. Connector/J source is available.

What is Python?
Python is a popular programming language. It was created by Guido van Rossum,
and released in 1991.

It is used for:

 web development (server-side),


 software development,
 mathematics,
 System scripting.

What can Python do?


 Python can be used on a server to create web applications.
 Python can be used alongside software to create workflows.
 Python can connect to database systems. It can also read and modify files.
 Python can be used to handle big data and perform complex mathematics.
 Python can be used for rapid prototyping, or for production-ready software
development.

Why Python?
 Python works on different platforms (Windows, Mac, Linux, Raspberry Pi,
etc).
 Python has a simple syntax similar to the English language.
 Python has syntax that allows developers to write programs with fewer
lines than some other programming languages.
 Python runs on an interpreter system, meaning that code can be executed
as soon as it is written. This means that prototyping can be very quick.
 Python can be treated in a procedural way, an object-orientated way or a
functional way.

Good to know
 The most recent major version of Python is Python 3, which we shall be
using in this tutorial. However, Python 2, although not being updated with
anything other than security updates, is still quite popular.
 In this tutorial Python will be written in a text editor. It is possible to write
Python in an Integrated Development Environment, such as Thorny,
Pycharm, Netbeans or Eclipse which are particularly useful when managing
larger collections of Python files.

Python Syntax compared to other


programming languages
 Python was designed for readability, and has some similarities to the
English language with influence from mathematics.
 Python uses new lines to complete a command, as opposed to other
programming languages which often use semicolons or parentheses.
 Python relies on indentation, using whitespace, to define scope; such as the
scope of loops, functions and classes. Other programming languages often
use curly-brackets for this purpose.
SYSTEM IMPLEMENTATION

Hardware used:

While developing the system, the used hardware are:


PC with Pentium IV processor or sometimes,
PC with Celeron (1.7 GHz) processor having
256 MB RAM, SVGA and other required devices.

Software used:

 Microsoft Windows® XP as Operating System.

 Python as Front-end Development environment.

 MySQL as Back-end Sever with Database for Testing.

 MS-Word 2007 for documentation.


INFORMATICS PRACTICES

SQL:

IDLE:

1. Show all the records


2. Add records

3. Search record

i. ID
ii. NAME

iii. DEPARTMENT

iv. GENDER
v. HIRE DATE

vi. SALARY

4. Delete record
5. Graphical Representation

i. EMPLOYEES DEPARTMENT

Input:

Output:
2. Gender Graph

i. INPUT

ii. OUTPUT
6. Update record

i. ID

ii. NAME

iii. DEPARTMENT
iv. GENDER

v. HIRE DATE

vi. SALARY
7. EXIT

CODING:
ans="y"
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';"
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;"
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
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()
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)
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)
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)
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)
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)
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('')

df=pd.DataFrame({"id":row[0],"name":row[1],"department":row[2],"gender":row[3],"hiredate":row[
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)
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:")
REFERENCE

 Computer Science with Sumita Arora


 Computer Science with Preeti Arora
 www.wikipedia.org

You might also like