Computer
Science Project
Bank Management System
NAME: NEHAL THOMAS BINU
CLASS: XII-A
ROLL NUMBER: 32
ACADEMIC YEAR: 2023-2024
BONAFIDE CERTIFICATE
UNITED INDIAN SCHOOL, KUWAIT
This is to certify that the project on BANK MANAGEMENT
SYSTEM is done by NEHAL THOMAS BINU of Class XII-A
during the academic year 2023-2024.
Dated: _____________ _______________________
Mrs. Shalini Ninan
United Indian School
Kuwait
Dated:
External Examiner
Submitted for ALL INDIA SENIOR SECONDARY SCHOOL
CERTIFICATE PRACTICAL EXAMINATION held in
Computer Science Lab at United Indian School, Kuwait.
1
ACKNOWLEDGMENT
I am overwhelmed in all humbleness and gratefulness to
acknowledge my gratitude to all those who have helped
me
to put these ideas, well above the level of simplicity and
into something concrete.
I would like to express my special thanks to my
teacher Mrs. Shalini Ninan, as well as my
Principal Mr.RadhaKrishnana C who gave me the golden
opportunity to work on
this wonderful project on the topic ‘Bank Management
System’.
This project offered me an opportunity for
research, as a result of which I could gather so
many
valuable information.
The support and guidance of my parents and friends
played a significant role in completing this project with
utmost satisfaction. My deepfelt gratitude to my
parents who
helped me a lot in gathering different information,
2
collecting data and guiding me from time to time in
making this project, despite of their busy schedules.
A special mention
of gratefulness to my friends for their precious support.
THANK YOU
3
INDEX
SNO. TOPIC PAGE NO.
1. Abstracts 4-6
Features of Python 4
Features of MySQL 6
Python- MySQL 8
connectivity
2. Hardware and Software 10
Specification
3. Need of Computerization 11
4. Aim of the project 12
5. Source Code 13-23
6. Output Screens 24-34
7. Bibliography 35
4
ABSTRACTS
About Python,
Python is an open source, object oriented, high-level
programming language, which was developed by Guido
van Rossum in 1991.
Features of Python:
1. Easy to use (user friendly): Python is compact & very
easy to use object oriented language with very simple
syntax rules. It is a high level programming language
that has English like syntax. This makes it easier to
read and understand the code.
2. 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
5
debug language & thus suitable for beginners to
advanced users.
3. Cross-platform Language: Python can run across
different platforms like Windows, Linux, Mac OS and
other OS
4. Free and Open Source: Python is freely available,
open source, portable language. And not only is it
free, its source code is also available.
6
About MySQL,
MySQL is a free open source RDBMS software that
uses structured query language. It is a fast and
reliable RDBMS. It was invented by Michael Widenius
and the logo of MySQL is a dolphin named “Sakila”.
Features of MySQL:
1. Speed: My SQL runs very fast.
2. Free of cost: MySQL is available free of cost, i.e,
MySQL is an open source of software i.e, one
can freely download the software from the
internet.
3. Ease of use: It is a high-performance, relatively
simple database system and can be managed
from the command line.
7
4. Portability: It can be used easily on multiple
CPUs and is available on multiple platforms.
5. Security: It offers privilege and password
system that is very flexible and secure and
allows the verification by the host computer.
6. Data types: It provides many data types to
support different types of data.
8
• Python- MySQL Connectivity
The term “front-end” refers to the user interface,
while “back-end” means the server, application
and database that work behind the scenes to
deliver information to the user.
The user enters a request through the interface.
Examples of “front-end”: PHP, Java, Python
Examples of “back-end” databases: MySQL, SQL
Server, Postgres SQL, Oracle.
To connect from Python to MYSQL, we need a
library called MYSQL connector
Steps to create a database connectivity Python
application are:
9
1. Start Python
2. Import the Packages required for database
programming
3. Open a connection
4. Create a cursor instance
5. Execute a query
6. Extract data from result set
7. Clean up the environment
8. Data types: It provides many data types to support
different types of data.
10
Hardware and Software Specifications
Hardware requirements:
1. Processor: INTEL 80386 COMPATIBLE OR ABOVE
2. RAM: 4.0 MB
3. VDU: VGA/SVGA
Software requirements:
1. Operating System: WINDOWS NT, XP, VISTA, 7, 8
2. Python with Spyder Interface: Version 3.8
3. MySQL: Version 5.7
11
NEED FOR COMPUTERISATION
Computers have made great inroads in our everyday lives
and thinking.
Computers can access and process data hundred times
faster than human beings do. They are used for all sorts of
applications ranging from complex communication in the
field of research, engineering simulation, down to
teaching, printing books and recreational games, The ease
with the computer processes data and retrieve it
painlessly has made it inevitable in the office and business
environment.
Therefore, it is essential for every educated person to
know about computers, its strength, its weakness and its
internal structure. This project on ‘Bank Management
System’ plays an important role, it not only saves time but
also makes it easy for the computer operator or everyone
to do their work which in turn also saves a lot of paper
and other stationary required, thus bringing down the
cost. It also helps in the removal of manual work which
could otherwise cause duplication and mismatch of data.
12
AIM OF THE PROJECT
This project on Bank Management System aims at
creating a program which helps to add, delete, modify,
searching, displaying a record from a database relation
stored in MySQL.
The Functions that the program can perform are:
1. Displaying All Records
2. Inserting records
3. Display specific records
4. Select a particular person.
5. Matching names of persons and the reservation they
made.
6. Grouping records and finding number of occurrences
7. Deleting specified records
8. Modifying the record
9. Exit
13
BANK MANAGEMENT SYSTEM
14
Name of Database: Nehal
Name of Table: Bank
TABLE STRUCTURE:
15
SOURCE CODE:
import mysql.connector as sql
from tabulate import tabulate
mycon=sql.connect(host='localhost',user='root',passwd='password')
if mycon.is_connected()== False:
print("Error connecting to MySql database")
cursor.execute('create database if not exists nehal ')
cursor.execute('use nehal')
cursor.execute('create table if not exists bank ( Acc_Number int(10),Name
char(30),Acc_Type char(20),Address char(50),DOJ date,Amount float(15,3))')
mycon.commit()
q="insert into Bank
(Acc_Number,Name,Acc_Type,Address,DOJ,Amount)values
(%s,'%s','%s','%s','%s',%s)"%(1256,'ANN','Savings','Delhi','2002-12-01',150000)
cursor.execute(q)
q1="insert into Bank
(Acc_Number,Name,Acc_Type,Address,DOJ,Amount)values
(%s,'%s','%s','%s','%s',%s)"%(1200,'NEVIN','Savings','MUMBAI',
'2022-12-10',300000)
cursor.execute(q1)
q2="insert into Bank
(Acc_Number,Name,Acc_Type,Address,DOJ,Amount)values
16
(%s,'%s','%s','%s','%s',
%s)"%(1500,'KEVIN','NRI','KUWAIT','2023-01-20',200000)
cursor.execute(q2)
mycon.commit()
#SelectAll()
def SelectAll():
cursor.reset()
cursor.execute('select * from Bank')
data=cursor.fetchall()
count=cursor.rowcount
print("Total number of records retrieved from result set:",count)
h=['Acc_Number','Name','Acc_Type','Address','DOJ','Amt']
print(tabulate(data,headers=h,tablefmt='psql'))
#Selectspecific()
def Selectspecific(req_number):
cursor.reset()
cursor.execute("Select * from Bank where Acc_Number =%s" %
(req_number))
data=cursor.fetchall()
count=cursor.rowcount
17
print("Total number of records retrieved from result set:",count)
h=['Acc_Number','Name','Acc_Type','Address','DOJ','Amt']
print(tabulate(data,headers=h,tablefmt='psql'))
#Select_Customer()
def Select_CUSTOMER(m,n):
cursor.reset()
cursor.execute("Select * from Bank where Acc_Number = %s and
Name='%s'"%(m,n))
data=cursor.fetchall()
count=cursor.rowcount
print("Total number of records retrieved from result set:",count)
h=['Acc_Number','Name','Acc_Type','Address','DOJ','Amt']
print(tabulate(data,headers=h,tablefmt='psql'))
#insertrecord()
def insertrecord():
while True:
Acc_Number=int(input("Enter the Account Number: "))
Name=input("Enter the name of the Customer: ")
Acc_Type=input("Enter the Type of account: ")
18
Address=input("Enter the Address: ")
DOJ=input("Enter the Date of Joining: ")
Amt=input("Enter the Amount to Deposit: ")
query1="insert into Bank
(Acc_Number,Name,Acc_Type,Address,DOJ,Amount)
values(%s,'%s','%s','%s','%s',%s)"
%(Acc_Number,Name,Acc_Type,Address,DOJ,Amt)
cursor.execute(query1)
mycon.commit()
ch=input("DO YOU WANT TO CONTINUE(Y/N)?")
if ch.upper()=='N':
break
#APmatch()
def APmatch():
cursor.execute("Select Acc_Number,Name from Bank")
data = cursor.fetchall()
h=['Acc_Number','Name']
print(tabulate(data,headers=h,tablefmt='psql'))
19
#Group()
def Group():
cursor.reset()
g_con = input("Enter the attribute to group by: ")
ch = input("Is there a having clause?(Y?N): ")
if ch in ['Y','y']:
having_con = input("Enter the having clause: ")
query2 = "select %s, count(*) from Bank group by %s having %s" %
(g_con,g_con,having_con)
elif ch in ['N','n']:
query2 = "select %s, count(*) from Bank group by %s" %
(g_con,g_con)
cursor.execute(query2)
data = cursor.fetchall()
h=['Acc_Type','Customer']
print(tabulate(data,headers=h,tablefmt='psql'))
#modify()
def modify():
cursor.reset()
20
ch = 'y'
while ch not in ['N','n']:
req_AccNo = int(input("Enter your Account Number : "))
new_AccNo = int(input("Enter your new Account Number: "))
Name = input("Enter your Name ")
AccType = input("Enter your Account Type ")
Add = input("Enter your Address: ")
DOJ=input("Enter the date of Joining: ")
Amt = float(input("Enter the Amount to be deposited: "))
query1 = "Update Bank set Acc_Number=%s, Name='%s',
Acc_Type='%s', Address='%s',DOJ ='%s',Amount= %s where
Acc_Number=%s" %
(new_AccNo,Name,AccType,Add,DOJ,Amt,req_AccNo)
cursor.execute(query1)
mycon.commit()
ch = input("DO YOU WANT TO MODIFY ANOTHER RECORD(Y/N)?:")
if ch.upper()=='N':
break
21
#delete()
def delete():
cursor.reset()
ch = 'Y'
while ch not in ['N','n']:
req_AccNo = int(input("Enter the Acc_Number of the record to be
deleted:"))
query = "delete from Bank where Acc_Number = %s" %
(req_AccNo)
cursor.execute(query)
mycon.commit()
ch = input("Do you want to delete another record?(Y/N): ")
if ch.upper()=='N':
break
ch=0
while ch!=9:
print('MENU')
print(' ')
print('1.DISPLAY ALL RECORDS')
print('2.DISPLAY SPECIFIC RECORDS')
print('3.SELECT A PARTICULAR CUSTOMER')
22
print('4.INSERT RECORDS')
print('5.MATCH CUSTOMER AND THE Acc_Number THEY HAVE')
print('6.GROUPING RECORDS AND FINDING NUMBER OF
OCCURRENCES')
print('7.MODIFY RECORDS')
print('8.DELETE RECORD')
print('9.EXIT')
ch=int(input('Enter your choice:'))
if ch==1:
SelectAll()
elif ch==2:
req_Acc_Number=int(input("Enter the Acc_Number whose record
you want to display:"))
Selectspecific(req_Acc_Number)
elif ch==3:
m=int(input("Enter the Acc_Number: "))
n=input("Enter the name: ")
Select_CUSTOMER(m,n)
elif ch==4:
insertrecord()
elif ch==5:
23
APmatch()
elif ch==6:
Group()
elif ch==7:
modify()
elif ch==8:
delete()
elif ch==9:
break
24
OUTPUTS
25
DISPLAYING ALL RECORDS
26
DISPLAYING SPECIFIC RECORD
DISPLAYING A PARTICULAR CUSTOMER
27
INSERT RECORDS28
DISPLAYING AFTER INSERTION
DISPLAYING ACCOUNT NUMBER
29
WITH CUSTOMER NAME
30
GROUPING WITHOUT CONDITION
GROUPING WITH CONDITION
31
MODIFYING A RECORD
32
DISPLAY AFTER MODIFYING
33
DELETING RECORDS
34
DISPLAY AFTER DELETION
BIBLIOGRAPHY
35
Computer Science with Python – Preeti Arora
Computer Science with Python – Sumita Arora
Thank You
36