LILAWATI VIDYA
MANDIRSCHOOL
COMPUTER
SCIENCE
PROJECT WORK
(2022-23)
Name: Kapish Verma
Class: 12"-E
Roll No: 12192
Subject: Computer Science Project
(CrimeRecord Management
System)
INDEX
1.
Acknowledgement
2.
Certificate
3. Front & Back End Used
4. About The Project
5. Source Code
6. Outputs
7. Future Scope
8. Bibliography
ACKNOWLEDGEMENT
I would like to express a deep sense of thanks and
gratitude to my project guide Ms. Aarti Bhandari for
guiding me immensely through the course of the
project. Her constructive advice and constant
successful
motivation have been responsible for the
completion of this project.
sincere thanksgo to Mrs. Sangeeta Sharma, our
My extending
coordination in
Principal Madam, for her
completion of this project.
everypossible support for
for their motivationand
lalso thank my parents
to my classmates for their
support. Imust thanks this project.
support for compilation of
timelyhelp and
Thank you
Kapish Verma
XII-E
CERTIFICATE
This is to certifythat Kapish Vermaof Class XIl E, has
Successfully carried out project work in Computer
Secondary
Science prescribed by the Central Board of
under
Education during the Academic Year 2022-23
Bhandari
the guidance of Ms.Aarti
Signature of
Signature of
Internal Examiner
External Examiner
Front-End and Back-End Used
Front-End: -
where
Front-End isthe development enironment
the program code to develop the
we write
that the user can communicate with
interface so
have taken Python to develop the
the system. I developed
programs were
project. Using IDLE
and tested.
Back-End: -
database which is working
Back-End refers to the used to store data. I
front-end. It is
in behind of
Back-End to store my data.
MYSQL as project work is
have taken developing
used for free and
Both software available as
by CBSE and freely
specified
open source.
About the project
POLICE CRIME RECORD INFORMATION SYSTEM
Crime records are the most important part of any
modern society for better controlling crime. Crime
database help us to recognize the type of crime right
to overcome
now happening in the system and how
that.
trying to solve this simple but very
This project is also
information of the crime. The whole
useful table crimerecord that
MySQL
Database is store in well as some other
position as
stores their current crime, years of
Information like place of
useful which crime took place etc.
imprisonment,act under
major parts i.e.
project is divided into four
and
The whole modification,searching into menus
addition ofdata, part are further divided
reporting. Allthese
for easy navigation
SOURCE CODE
import mysql.connector
import pickle
global mydb, cur
mydb= mysql.connector. connect (host='localhost'.
database='crime',
user=' root',
print ("Connection created ")
password='lvm123')
def bincrime():
d=['Records earlier added in table are:' (1, 'Rahul',21, 'online
fraud', '403A', 'jaipur','2020-05-03',3),\
(2, 'Suresh',36, 'theft', '402A', 'Raipur', '2020-12-06',2),\
(3, 'Om',38, 'Eve TEASING', ' 406A','delhi', '2020-05-08',6),\
(4,"Amar',42, 'Financial Cheating','409A', 'delhi','2020-06
12,4), \
(5, 'Dishant',48, ' Dacoity', '406A','4Ñ7B','2020-04-16',3)]
f=open('crimem.dat', 'wb')
pickle.dump(d, f)
print("binary file written")
f.close()
bincrime()
#Create cursor
cur = mydb.cursor()
cur.execute("drop database /crime")
cur.execute("create database crime")
Cur.execute("use crime")
#create crime record table
cr/merecord(id integer primary
query='create table if/not exists IpcSection
name varchar(20),age integer, crimetype varchar(30),
key, varchart20),tenure integer)'
varchar (30),city varchar (20),Date
cur.execute (query)
mydb. commit() (1, 'Rahul',21, 'online
Cur.execute("insert into crimerecord values
'jaipur','2020-05-03', 3)")
traud', '403A', crimerecord values
Cur,execute("insert into -06',2))
'402A', 'Raipur','2020-12'Om',
(2, 'Suresh',36, 'theft', values (3, 38, 'Eve
Cur.execute("insert into crimerecord
TEASING','406A','delhi','2020-05-08',6)") 'Financial
values (4, Amar',42,
Cur.execute("insert into crimerecord
Cheating','409A', 'delhi','2020-06-12',4)")
Cur..execute(""insert into crimerecord valUes
(5,'Dishant"',48, 'Dacoity', '406A', ' 407B',' 2020-04-16 ,3)")
mydb.commit()
def introduction():
msg = PO LICE CRIME REC0RD INF O0 RM
TION SYSTEM
print (msg)
def add_record():
name=input('Enter name of criminal\n:')
id=eval(input ("Enter criminal id: (Note: Criminal id is always
unique) "))
age=eval(input("Enter criminals age:\n"))
crimetype=input("What did criminal do:")
arrested:")
IpcSection=input("Under what IPC charges is criminal
place:")
city=input ("Which city did crime take
Date=input("Enter the arrest date:")
imprisonment:"))
tenure=(input("Enter number of years of
sq=
'insert into
crimetype, IpcSection, city, Date, tenure)
crimerecord(id, name, age, "", "O", "O")'.format (id,name,age,
values("", "0", ","","",
"{ ")",
IpcSection, city, Date, tenure)
crimetype,
cur.execute(sq)
mydb.commit()
print("'\n\nRecord added successfully')
search:')
def search record(): whom you want to
Id
id=input('Enter criminal
id={}'.format(id)
crimerecord where
query='select * from
cur.execute(query)
result=Cur, fetchall()
row=Cur.rowCount
if(row==1) (""\n\n{}\n\n".
: format(result))
print exist:")
else:print("Record does not
def delete_record():
id=eval(input ("\nEnter criminal
database:\n"))
id whom you want to remove from
auerv=' delete from crimerecord where id=%f'%%id)
cur.execute (query)
mydb. commit()
print("\n\n\nRecord deleted successfully\n\n")
def display_record():
print("1.Display all records\n2.Display criminals based on
specific crimetype\n3.Display criminals based on specific crime
place\nEnter choice:')
ch=eval(input())
if (ch==1):
print ("\n\nId \t Name \t Age \t Crime It IPC \tPlace\t
CrimeDate \t Tenure ")
s='select * from crimerecord'
cur.execute(s)
result=cur.fetchall()
#print(cur. fetchall())
for rec in result:
print (rec)
if(len (result) ==0): \n\n')
print(\n\n\nsorry, No records foúnd Vn
elif(ch==2):
crime criminals do you
crimetype=input('Enter what type øf
want:')
crimerecord where
S='select * from
crimetype="(}"".format(crimetype)
cur.execute(s) CrimeDate
result=Cur. fetchall()
Crime IPC Place
Age
print ("\n\nId Name
Tenure") result:
for rec in
print (rec)
if(len(result)==0): Records Found!!!\n\n')
!No
print('\n\n!!! are searching for
crimeplace=input('At
elif(ch==3) : which'place
crime?:') crimerecord where
S='select * from
City=")"".format (crimeplace)
cur.execute(s)
result=cur.fetchallO
print("\n\nId Name Age Crime IPC Place
CrimeDate Tenure ")
for rec in result:
print (rec)
if(len(result)==0):
print("\n\n!!!!No Records Found!!!\n\n')
def modify_record():
id=eval(input("Enter criminal id whose information you want to
update:"))
name=input('Enter name of criminal\n:')
age=eval(input("Enter criminals age:\n")
crimetype-input("What did criminal do: ")
criminal arrested: ")
IpcSection=input("Under what IPC charges is
place:")
city=input("Which city did crime take
date:")
Date=input("Enter the arrest
of imprisonment:"))
tenure=eval(input("Enter number off years
query='update crimerecord set tenure=%s
IpcSection=%s, city=%s, Date=%s,
age=%s,
name=%s,crimetype=%s,
where id=%s IpcSection, city, Date,
tenure, id)
b=(name, age,
crimetype,
cur.execute(query, b)
mydb.commit () successfully\n')
print("\nRecord modified
def main():
introduction()
print("\n\n\n")
while(True):
print(" database
to the database
1.Add records from
2.Search record
3.Delete Record
4.Display criminal records
5.Modify Records
6.Exit
Enter your choice:
")
ch=eval (input() )
if(ch==1):
add_record()
elif(ch==2):
search_record()
elif(ch==3):
delete_record()
elif(ch==4):
display _record()
elif(ch==5):
elifmodify_record()
(ch==6):
break;
#call main function
main()
OUTPUTS:
Table Created In MySQL:
mysql> use crime;
Database changed crimerecord;
mYsql> selectfrom tenure
Date
IpcSection city
age | crimetype 2620-05-03
id name jaipur
403A 2820-12-06
online fraud Raipur 6
21 402A 2020-05-08
1 Rahul theft delhi
36 406A 2620-06-12
2
Suresh Eve TEASING delhi
38 409A 2020-04-16
Om 42 Financial Cheating 407B
Amar
406A
4 48 | Dacoity
5 Dishant
(0.00 sec)
5 rous in set
Binary File Output:
fraud"E4034"Hjaipur"E
"crimem - Notepad ar¿:(KMHIRahul"KMtAonline
ile Edit Format View Help table
820-05-03"K]t"(K
E earlier added in
(EISuresh"K$Htheft"492A"HIRaipur"E
J(C#Records
TEASING"H406A"EIdelhi"E
Cheating"H409A"hXE
820-12-06K t"(KIKE Om'K&HIEve
(KIEJAmar"K*HF inancial
2B20-06-12"K]t"((KIEJDishant"KeHDacoity"h(EHJ497BE
P820-05-98"Kjt"(
2820-94-16"KOt"e.
OutputIn The Terminal:
Python Executed Program:
" Adding Records
Connection created
binary file Written SY S TEM
CR I ME RE C 0R D I N F 0R MA T I ON
POL ICE
database
1.Add records to the
database
2.Search record from
3.Delete Record
4.Display criminal records
5.Modify Records
6.Exit
Enter your choice:
1 criminal
Enter nane of
6
:Patel is always unique)
crininal id: (Note: Criminal id
Enter
Enter criminals age:
32
do: Theft arrested:489B
What did criminal
charges is criminal
Under what PC place:Goa
crime take
Which city did date:2022-12-06
Enter the arrest imprisonment:4
years of
Enter number of
Record added successfully
MySQL Output:
tenure
Bysql> selectfrom crimerecord; IpcSection | city 1Date
2020-05-03
id |age crimetype jaipur
name 403A 2020-12-06
online fraud 4024
Raipur 2020-05-08
1 Rahul 21 delhi 2020-06-12
36 theft 4064 delhi
Suresh Eve TEASING 409A 2028-04-16
Om 38 Financial Cheating 406A
4078 2022-12-06
Amar 42 Goa
48 | Dacoity 489B
Dishant
Theft
6 Patel 32
rOWs in set (e.92 sec
Python Executed Program:
" Searching Records
database
1.Add records to the database
from
2. Search record
3.Delete Record
4.Display oriminal records
5.Modify Records
6. Exit
Enter your choice:
search:4
want to
2 d whom you
Dnter crininal
2020-06-12', 4) ]
409A' delhi!
Financial Cheating
Amar! 42,
[(4,
Python Executed Program:
" Deleting Records
database
to the database
1.Add records fron
2.Search record
3.Delete Record
4.Display criminal records
5.Modify Records
6. Exityour choice:
Enter
database:
3
remove from
to
you want
Enter crininal id whom
3
Record deleted sucgessfully
MySQL Output:
selectfrom crinerecord;
age crinetype
id name IpcSection tity
Rahul 21 online fraud 4e34 Date tenur
Suresh 36 theft 402A jaipur 2028-05-03
2 Amar
48
42 Financial Cheating
Dacoity
409A
406A
Raipur
delhi 2020-12-06
Dishant
32 Theft 4898 4078 2020-06-12
Patel Goa 2028-04-16
2022-12-96
Set (e.ee sec)
Python Executed Program:
" Displaying Records
1.Add records to the database
2.Search record from database
3.Delete Record
4.Display criminal records
5.Modify Records
6.Exit
Enter your choice:
1.Display all records
2.Display criminals based on specific crimetype
3.Display criminals based on specific crime place
Enter choice:
1
CrimeDate Tenure
Id Crime IPC Place
Name Age 3)
(1, 'Rahul'. 21, 'online fraud' 403A', jaipur', 2020-05-03,
(2, 'Suresh! 36, theft', 402A', Raipur', 2020-12-06 , 2)
delhi', 2020-06-12, 4)
42, 'Financial Cheating' r 409A'
(4, 'Amar',
(5, 'Dishant', 48, Dacoity'
407B', 2020-04-l6', 3)
406A!
(6, 'Patel', Theft', 489B Goa 2022-12-06' , 4)
32,
Displaying Records based on specific crime type
1.Display all records crinetype
D1splay Criminals based on specifig Place
D1splay criminals based on specific grine
Enter choice:
criminals do you Want:Thert
Wrhat type of arime
TenuIe
Id CrimeDate 2020-12-06, 2)
Place
Name Age Crime IPC
KaP-19-o6, 4)
(2, Suresh', 36, theft!, 402A'
Goa!,
(6, Patel!, 32, Theft', 489B',
specific crime place
Displaying Records based on
databae
records to the
1 Add databasa
9 Search record from
3.Delete Record
ADisplay Criminal records
5. Modify Records
6.Exit
choi ce:
Enter your
1.Display a l l recorde
4 crininals based on
specific orime type
specific crime place
2.Display crininals based on
3.Display
Enter choice:
orime?:jaipur
are searching for
3 place you
At which
Place CrineDate Tenure
Crime IPC
Name Age online fraud', 403A', jaipur', 2020-05-03', 3)
Id
(1, 'Rahul' 21,
Python Executed Program:
Modifying Records
the database
1.Add recOrds to database
2.Search record from
3.Delete Record
4.Display crininal records
5.Modify Records
6.Exit
Enter your choice:
5 update:2
Enter oriminal id whose information you want to
Enter name of criminal
iSuresh
Enter criminals age:
36
a t did crininal do :Cyber Bullying arrested:85-A
Under what IPC harges is criminal
Which city did crime take place:Srinagar
Enter the arrest date:2020 -06-12
Enternumber of years of imprisonment:2
eGOrd modified successfully
MysQL Output:
sgl> selectfrom crimerecord;
Ipcsection city Date tenure
id name age crimetype
2020-5-03
Rahul 21 online fraud 403A jaipur
Srinagar 2026-06-12
Suresh 36 Cyber Bullying 85-A
delhi 2020-06-12 4
Amar 42 Financial Cheating 409A
407B 2026-04-16 3
406A
5 | Dishant 48 Dacoity
489B Goa 2022-12-06
6 Patel 32 | Theft
rows in set (0.00 sec)
FUTURE SCOPE
Theneed,for a computerized platform for crime record
management cannot be over emphasized. The Crime
Management System enhances proper and
management oficriminal records
efficient
in mmakinginformed decisions andimproving
helping enforcement operations.
reliability thusimproving law
crime rate in the country thereby
This results in lower
security. Conviction ofcriminals
increasing national backbone of
highly responsive
depends on a efficiency of the police
Management. The
Information tackles crime
which it
effectiveness with derive
and the informationitcan
depend on what quality of fast it canhave
and hów
from its existing records
access to it.
BIBLI
IOGGRAPHY
BOOKS:
ComputerScience with
with Python: Textbook for
" Preeti Arora
CBSEClass 11:
Science with Python: Textbook for
. Computer Arora
Class 12: Preeti
CBSE
WEBSITES:
" https://www.geeksforgeeks.org/
" https://www.pyforschool.com/
"https://pythonworld.in/
THANK YOU