BONAFIDE CERTIFICATE
This is to certify that this practical work is done by AYUSH ANAND
GEORGE of class XII-A in the Computer Science Lab during the
academic year 2023-2024.
P.G.T in Computer Science
DATED: ----------------- -----------------------------
Mrs. Shalini Ninan
United Indian School
Kuwait
DATED: ------------------- ------------------------------
External Examiner
Submitted to ALL INDIA SENIOR SCHOOL CERTIFICATE
PRACTICAL Examination held in Computer Science Lab at
United Indian School, Kuwait.
Page | 1
DECLARATION
“I hereby declare that this Project title FBI AGET PROFILE
is an authentic work prepared by me during the academic year
2023-2024 under the guidance of Mrs. Shalini Ninan.”
Page | 2
ACKNOWLEDGEMENT
I would like to express my sincere gratitude to my
computer teacher Mrs. Shalini Ninan.”, who gave
me this golden opportunity to work on this
wonderful project on the topic ‘FBI AGENT PROILE’.
This project offered me a research opportunity, as a
result of which I could gather so much valuable
information. Finally, words are not sufficient to
express gratitude to my cherished family members
and my friends for supporting me, without their
encouragement and support I would have not
reached this stage.
Page | 3
SNO. TOPIC PAGE NO.
1. Abstracts 5-7
Features ofPython 5
Features ofMySQL 6
Python- MySQL 7
connectivity
2. Hardware andSoftware 8
Specification
3. Need of Computerization 9
4. Aim of theproject 10
5. Source Code 13-16
6. Output Screens 17-20
7. Bibliography 21
Page | 4
ABSTRACTS
FEATURES OF PYTHON
Python is an open-source, object-oriented, high-level programming
language, which was developed by Guido van Rossum in 1991.
FEATURES:
* Easy to use (user-friendly):
Python is a compact & very easy-to-use object-oriented language with
very simple syntax rules. It is a high-level programming language that
has an English-like syntax. This makes it easier to read and understand
the code. -
* Interpreted language:
Python is an interpreted language. Python interpreter interprets and
executes the code, line by line at a time. So, it’s an easy-to- debug
language & thus suitable for beginners to advanced users.
* Cross-platform Language:
Python can run across different platforms like Windows, Linux, Mac OS
and other OS.
* Free and Open Source:
Python is a freely available, open-source, portable language. And not
only is it free, but its source code (Complete program instruction) is also
available.
Page | 5
FEATURES OF MYSQL
MySQL is a free open-source RDBMS software that uses
structuredquery language. It is fast and reliable RDBMS. It was invented
by Michael Widenius and the logo of MySQL is a dolphin named
“Sakila”.
FEATURES:
Speed: My SQL runs very fast.
Free of cost: My SQL is available free of cost, i.e., My SQL is an open
source of software i.e., one can freely download the software from the
internet.
Ease of use: It is a high-performance, relatively simple database system
and can be managed from the command line.
Portability: It can be used easily on multiple CPUs and is available on
multiple platforms.
Security: It offers a privilege and password system that is very flexible
and secure and allows verification by the host computer.
Data types: It provides many data types to support different types of
data.
Page | 6
Python-MySQL Connectivity
Python is the front end where we are able to design whereas MySQL is the
back end where the data gets stored. To create a connection between the
MySQL database and the python application, the connect () method of
MySQL, connector is used.
STEPS TO CREATE A DATABASE CONNECTIVITY
PYTHON APPLICATION ARE:
Start Python
Import the packages required for database programming.
Open a connection
Create a cursor instance
Execute a query
Extract data from result set
Clean up the environment.
Page | 7
HARDWARE AND SOFTWARE
SPEICIFICATION
Hardware requirement:
Processor: INTEL 80386 compatible or
above RAM: 4.0MB VDU: VGA/SVGA
Software requirements:
Operating System: WINDOWS NT, XP, VISTA, 7, 8
Python with Spyder Interface: Version 3.7
MySQL: Version 8.0
Page | 8
Effects of Computerization
The main advantages of computerizing the activities of business
organization are as follows:
Advantages:
1. Speed: Computerization helps in processing the data placed in several
data file in no time. This is possible due to the high speed of computers for
processing data and CPU of the computer works at the speed of the
electricity, which is the highest ever attainable speed.
2. Accuracy: the data processed by the computer are highly accurate. The
programs written on the system checks and control data before and during
processing. It detects invalid data and ensures high degree of accuracy and
reliability of output reports.
3. Flexibility: the modern digital computers can be used for a variety of
[Link]: online processing, multiprogramming etc.
4. Choices of Configuration: Wide ranges of peripherals are available for
many computer systems, which allow business organization to elect those,
which most suits its processing requirements.
5. Storage capacity: large volumes of data can be conveniently stored,
accessed and altered. Due to the computer advancement, it made the
operators and project makers like us to save a lot of space, a lot of cost and
a lot of time.
Page | 9
AIM
This project of FBI AGENT PROFILE aims at
creating a program which help to add, delete,
modify, searching, displaying a record from a
database relation stored in MySQL.
1. CREATING AGENT PROFILE
2. AGENT DETAILS
3. INSERTING NEW PROFILE
4. MODIFYING AGENT PROFILE
5. DELETE PROFILE
6. EXIT
Page | 10
Page | 11
DOCUMENTATION
Name the Database: POLICE
Name the table: FBI
Page | 12
SOURCE CODE
import [Link] as sql
from tabulate import tabulate
mycon = [Link](host='localhost', user='root', passwd='password',
database='police')
if mycon.is_connected() == False:
print("Error connecting to MySQL database")
cursor = [Link]()
# Display all the Records
def SelectAll():
[Link]()
[Link]("SELECT * FROM FBI")
data = [Link]()
count = [Link]
print("Total number of records retrieved from result set:", count)
h = ['FN','FID','ADDRESS','DEPT','SALARY','DOJ']
print(tabulate(data, headers=h, tablefmt='psql'))
# Display a Specific Record
def selectspecific(n):
[Link]()
[Link]("SELECT * FROM fbi WHERE FID='%s'" % (n))
data = [Link]()
count = [Link]
print("Total number of records retrieved from result set:", count)
h = ['FN','FID','ADDRESS','DEPT','SALARY','DOJ']
print(tabulate(data, headers=h, tablefmt='psql'))
Page | 13
# Inserting a New Record
def insertrecord():
while True:
FN = input('Enter the Name: ')
FID = int(input('Enter the ID: '))
ADDRESS = input('Enter the ADDRESS: ')
DEPT = input('Enter the Dept: ')
DOJ = input('Enter the Date: ')
SALARY= int(input('Enter the Salary: '))
query = f"insert into fbi (FN, FID, ADDRESS, DEPT, DOJ, SALARY) values
('{FN}', {FID}, '{ADDRESS}', '{DEPT}', '{DOJ}', {SALARY})"
[Link](query)
[Link]()
SelectAll()
ch = input('Do you want to insert another record? (Y/N): ')
if [Link]() == 'N':
break
# Modifying a Record
def modify():
[Link]()
while True:
FID = int(input("Enter the FID whose record you want to modify: "))
FN = input("Enter the Name: ")
ID = int(input("Enter the ID: "))
ADDRESS = input("Enter the ADDRESS: ")
DEPT = input("Enter the Dept: ")
DOJ = input("Enter the Date: ")
SALARY = int(input("Enter the Salary: "))
query = f"update fbi set FN='{FN}', FID={ID}, ADDRESS='{ADDRESS}',
DEPT='{DEPT}', DOJ='{DOJ}', SALARY={SALARY} where FID={FID}"
[Link](query)
[Link]()
Page | 14
ch = input('Do you want modify another record? (Y/N): ')
if [Link]() == 'N':
break
# Deleting a Record
def delete():
[Link]()
while True:
FID = int(input("Enter the FID of the record to be deleted: "))
query = f"delete from fbi where FID = {FID}"
[Link](query)
[Link]()
ch = input("Do you want to delete another record? (Y/N): ")
if [Link]() not in ['Y', 'N']:
print("Invalid choice. Please enter 'Y' or 'N'.")
if [Link]() == 'N':
break
while True:
print('MENU')
print('1. DISPLAY ALL RECORDS')
print('2. DISPLAY SPECIFIC RECORDS')
print('3. INSERT RECORDS')
print('4. MODIFY RECORDS')
print('5. DELETE RECORD')
print('6. EXIT')
ch = int(input('Enter your choice: '))
if ch == 1:
SelectAll()
elif ch == 2:
n = input("Enter the FID whose record you want to display: ")
selectspecific(n)
Page | 15
elif ch == 3:
insertrecord()
elif ch == 4:
modify()
elif ch == 5:
delete()
elif ch == 6:
break
Page | 16
OUTPUT FOR THE ABOVE PROGRAM
DISPLAY ALL RECORDS:
DISPLAY A SPECFIC RECORD
Page | 17
INSERTING A NEW RECORD:
Page | 18
MODIFY RECORDS:
DELETING A RECORD
Page | 19
EXIT
Page | 20
BIBLIOGRAPHY
Computer Science with PYTHON-Preeti Arora
Computer Science with PYTHON-Sumita Arora
NCERT Reader-Class XI &Class XII
Page | 21