Dbms Mini Project Report FINAL
Dbms Mini Project Report FINAL
Dbms Mini Project Report FINAL
Prithviraj K
(3GN21AI040)
Rahul Reddy
(3GN21AI041)
Sachin V Bacha
(3GN21AI044)
Under the Guidance of
Prof.Netravati S
CERTIFICATE
This is to certify that the Database Management System Project work entitled Crime Database
Management System has been carried out by Prajwal M (3GN21AI037), Prithviraj
(3GN21AI040), Rahul Reddy (3GN21AI041) , Sachin V Bacha (3GN21AI044) bonafide
students of Guru Nanak Dev College Bidar in partialfulfillment for the Completion of 5th Sem
of Bachelor of Engineering in Artificial Intelligence And Machine Learning of the
Visvesvaraya Technological University, Belgaum during the year 2023-2024. It is certified that
all corrections/suggestions indicated for Internal Assessment have been incorporated in the
Report deposited in the departmental library. This DBMS Project Report has been approved as
it satisfies the academic requirements in respect of project workprescribed for the said degree.
----------------- -------------------
External Viva
Name of the examiners Signature with date
1.
2.
lOMoARcPSD|28011495
ACKNOWLEDGEMENT
It gives us a great sense of pleasure to present the report of the B.E. Mini Project undertaken during the 5th
semester. We also take the opportunity to acknowledge the contribution of Dr.Dayanand J. Sir, HOD. of the
Department of Artificial Intelligence and Machine Learning, Guru Nanak Dev Engineering College Bidar,
for his full support and assistance during the development of the project. It is only through his cognizant
efforts that our endeavors have seen the light of day. We owe a special debt of gratitude to Mrs. Netravati
S., Department of Artificial Intelligence and Machine Learning, Guru Nanak Dev Engineering College
Bidar, for her constant support and guidance throughout the course of our work. Her sincerity, thoroughness,
and perseverance have been a constant source of inspiration for us. We also do not like to miss the
opportunity to acknowledge the contribution of all faculty members of the department for their kind
assistance and cooperation during the development of our project. And last but not least, we acknowledge
our friends for their contribution to the completion of the project.
Prajwal Mathapati
Prithviraj Kalyan
Rahul Reddy
Sachin V Bacha
lOMoARcPSD|28011495
II
ABSTRACT
The Crime Database project aims to provide a straight-forward yet efficient solution for managing crime-
related data through a relational database system. The database consists of three primary tables: person,
incident, and participation.
This simplified structure allows users to seamlessly insert and retrieve data pertaining to criminal incidents,
suspects involved, and victims affected. The incident table serves as the core repository for information
regarding criminal events, capturing details such as incident ID, date, time, location, description, and severity.
The system provides robust functionality for data retrieval, allowing users to query the database based on
various criteria such as incident details, suspect attributes, or victim demographics. By leveraging SQL queries
or a user-friendly interface, users can swiftly access relevant information for investigative, analytical, or
reporting purposes.
Overall, the Crime Database offers a user-friendly platform for law enforcement agencies, investigators, and
other stakeholders to manage and analyze crime-related data effectively. Its streamlined approach to data
insertion and retrieval aims to enhance operational efficiency and support informed decision-making in the
realm of criminal justice.
lOMoARcPSD|28011495
TABLE OF CONTENTS
ACKNOWLEDGEMENT I
ABSTRACT II
Chapter 1
INTRODUCTION
The objective of the crime database management system is to allow investigators or users to edit
and find out the crime details of a criminal. It’ll also facilitate keeping all the records of criminals,
such as their ID, name, DOB, events committed, description, time, location, etc. So that all the
information about any crime and criminal will be available in seconds. Overall, it’ll help law
enforcement agencies, investigators, and other stakeholders manage and analyze crime-related
data effectively. The main purpose of this project is to illustrate the requirements of the project
Crime Database Management System and is intended to help and support informed decision-
making in the realm of criminal justice.
The system provides robust functionality for data retrieval, allowing users to query the database
based on various criteria such as incident details, suspect attributes, or victim demographics. By
leveraging SQL queries or a user-friendly interface, users can swiftly access relevant information
for investigative, analytical, or reporting purposes.
It provides a single source of data for streamlining your business processes and for all reporting
purposes. It has a simple user interface and is intuitive. This ensures that the users spend less time
learning the system and, hence, increase their productivity. Efficient security features provide data
privacy and, hence, increase their productivity.
Chapter 2
SYSTEM REQUIREMENTS
To demonstrate and work with this project there few hardware and software requirements that
are to be satisfied To work with any storage system we need a database installed into our system
and as this project is made as an stand alone application any frontend tool can be used to design
and develop it .The major Hardware and Software requirements are listed below.
● Python (version-3.11.0)
● Db2(version-3.1.0)
● Streamlit
● Pandas
1. Python:
- Python is a versatile and widely used programming language known for its simplicity and
readability.
- In this project, Python is likely used for various tasks such as backend development, scripting, and
data manipulation.
2. DB2:
- DB2 is a relational database management system (RDBMS) developed by IBM.
- It's commonly used for enterprise-level database solutions, offering features such as ACID
(Atomicity, Consistency, Isolation, Durability) compliance, scalability, and reliability.
- In this project, DB2 is likely used as the backend database to store and manage the data.
3. Streamlit:
- Streamlit is an open-source Python library used for building interactive web applications for data
science and machine learning projects.
- It allows developers to create web applications quickly by writing Python scripts.
- In this project, Streamlit is likely used to create a user interface (UI) for interacting with the
DBMS, providing features such as data visualization, querying the database, and displaying results.
4. Pandas:
- Pandas is a powerful Python library used for data manipulation and analysis.
- It provides data structures and functions to efficiently work with structured data, such as data
frames.
- In this project, Pandas is likely used for tasks such as reading data from the database, performing
data manipulation and analysis, and preparing data for visualization or presentation.
Overall, this project seems to be a combination of backend development with Python and DB2,
coupled with frontend development for data visualization and interaction using Streamlit. Pandas is
likely used for intermediate data processing tasks within the Python code.
Chapter 3
DESIGN
The overall design objective is to provide an efficient, modular design that will reduce the system’s
complexity, facilitate change and result in an easy implementation. This will be accomplished by
designing a strong cohesion system with minimal coupling. The purpose of the design phase is to
develop a clear understanding of what the developer wants people to gain from the project. The
database application system may be divided into two kinds: one is data-centric and the other is
process-centric. The former takes the data provided as the goal, and the data acquisition, the
database construction and maintenance as the key point. Although the latter also includes these,
the emphasis is the service data, that is carrying on inquiry, statistics, report output and so on. In
this article the student information management database application system is mainly process-
centric.
Following the functional requirement of the student information management database application
system, the overall structure of the application system could be indicated with the hierarchy chart,
from the top to down: Layer 1 is the system layer, Layer 2 is the function layer, Layer 3 for
operation layer. Figure 3.1 is the overall structure of the student information management database
application system.
Figure 3.
Chapter 4
IMPLEMENTATION
Crime database systems contain information about important people, places, and things within the
organization or in the environment surrounding it. Information is data that has been designed into a
form that is meaningful and useful to human beings. Data, in contrast, are streams of raw facts
representing events occurring in organizations or the physical environment before they have been
organized into a form that people can understand and use.
Implementing a designed database is critical for all operations. A good database does not allow any
form of anomaly and stores only relevant information in an ordered manner. If a database has
anomalies, it is affecting its efficiency and data integrity. For example, a delete anomaly arises upon
the deletion of a row, which also forces other useful data to be lost. As such, the tables need to be
normalized. Only this kind of database provides a result unambiguously.
As this is a complete web-based system, there are two techniques: frontend and backend. Frontend
means the design of the website or the design of the interface of the web application. Programming
languages coming under Frontend: Python with streamlit Library. Backend means server-side
programming; it communicates the client interface with the database and the logic control.
Programming languages coming under Backend: Python,Db2.
First, create a database according to the given ER diagram and Schema diagram. In Selected
Schema, there are three tables: two normal tables and one relationship table.
After creating the tables in the crime database, it is now time to develop the frontend of the project
that connects the database to the server and provides a smooth user interface using Python and
Streamlit, which helps in the insertion of data into the database and retrieval of the required data
using Query.
dsn_hostname=os.getenv("Host_name")
dsn_uid= os.getenv("uid")
dsn_pwd=os.getenv("password")
dsn_port= os.getenv("Port_number")
dsn_database=os.getenv("database")
dsn_driver = "{IBM DB2 ODBC DRIVER}"
dsn_protocol = "TCPIP"
dsn_security = "SSL"
dsn = (
"DRIVER={0};"
"DATABASE={1};"
"HOSTNAME={2};"
"PORT={3};"
"PROTOCOL={4};"
"UID={5};"
"PWD={6};"
"SECURITY={7};").format(dsn_driver, dsn_database, dsn_hostname, dsn_port, dsn_protocol,
dsn_uid, dsn_pwd,dsn_security)
try:
conn = ibm_db.connect(dsn, "", "")
print ("Connected to database: ", dsn_database, "as user: ", dsn_uid, "on host: ", dsn_hostname)
# return conn
except:
print ("Unable to connect: ", ibm_db.conn_errormsg() )
# return None
sql = "INSERT INTO Incident (crimetype, time, st_name, city) VALUES (?, ?, ?, ?)"
if last_iid:
return last_iid[0]
else:
return None
except Exception as e:
return False ,f"Failed to insert incident data: {e}"
# # Validate role
# valid_roles = ['Victim', 'Witness', 'Suspect']
# if role not in valid_roles:
# return False, f"Role should be one of {', '.join(valid_roles)}"
except Exception as e:
return False, f"Failed to insert participation data: {e}"
data = []
result = ibm_db.fetch_assoc(stmt)
while result:
data.append(result.copy())
result = ibm_db.fetch_assoc(stmt)
return data
except Exception as e:
return None, f"Error executing SQL query: {e}"
# return None
import os
import streamlit as st
from sql import
connect_to_db,check_db_connection,insert_person_data,dsn,insert_incident_data,insert_participati
on_data,execute_query,select_all_data,select_specific_columns,retrieve_suspects
import pandas as pd
def insertion_page():
# Connect to the database
conn = connect_to_db(dsn)
tab1, tab2, tab3 = st.tabs(["Add Person Data", "Add Incident Data", "Add Participation Data"])
# Page for adding data to Person table
with tab1:
def retrival_page():
# Connect to the database
conn = connect_to_db(dsn)
if selected_columns:
data = select_specific_columns(conn, table_name, selected_columns)
if data:
df = pd.DataFrame(data)
st.write('Query Result:')
st.dataframe(df)
else:
st.warning('Please select at least one column.')
elif query_type == 'Retrieve Suspects':
role = st.selectbox('Select role:', ['victim', 'witnessed', 'suspect'])
data = retrieve_suspects(conn, role)
if data:
df1=pd.DataFrame(data)
st.write('Query Result:')
st.write(df1)
st.set_page_config(
page_title="Crime databse Application",
page_icon=" ",
layout="wide",
initial_sidebar_state="expanded",
if __name__ == '__main__':
main()
Chapter 5
APPICATION SCREENSHOTS
The Figure 5.1 is the Data Insertion page for the application
The Figure 5.2 is the Data Retrieval page for the application
Chapter 6
Overall, efficiency has improved and work processes have been simplified. Although all the
objectives have been met, the system still has room for improvement. The system is robust and
flexible enough for future upgrades using advanced technology and devices. It was a wonderful
learning experience for us while working on this project. This software is very easy to use, so
everyone can use it frequently. We can hope that our software will be very popular and get sponsors
to develop it in the future.
The project has a very vast scope in the future. The project can be implemented on the intranet in
the future. The project can be updated in the near future as and when the requirement for the same
arises, as it is very flexible in terms of expansion. With the proposed software for database Space
Manager ready and fully functional, the client is now able to manage and hence run the entire work
in a much better, more accurate, and error-free manner.
➢ Data Integration: Explore the integration of external data sources such as criminal records
databases.
➢ User Interface Enhancement: Enhance the user interface of the database management system
to improve usability and accessibility for law enforcement personnel, enabling efficient data
entry, retrieval, and visualization of criminal information.
➢ Compliance and Security: Enhance data security measures to ensure compliance with privacy
regulations and safeguard sensitive information stored in the database. Implement access
controls, encryption, and auditing mechanisms to protect against unauthorized access and data
breaches.
➢ Scalability and Performance Optimization: Continuously optimize the database system for
scalability and performance to accommodate growing volumes of data and user traffic.
➢ Feedback and Iterative Improvement: Solicit feedback from users and stakeholders to identify
areas for improvement and prioritize future enhancements to the database system. Adopt an
iterative development approach to continuously enhance functionality, usability, and
effectiveness based on user needs and evolving requirements.
REFERENCES