PM SHRI KV NASIRABAD
SESSION 2025-26
A PROJECT REPORT ON
Bank Management System using Python and
MySQL
For CBSE 2025 Examination (As a part of the
Computer Science Course(083))
SUBMITTED BY:
Name: ________________________
Class & Section: XII – _____
Roll No.: ____________________
SUBMITTED TO:
Teacher’s Name: ______________
CERTIFICATE
This is to certify that ________________________, a student of Class XII
(Section ___) of PM SHRI KV NASIRABAD, has successfully completed the
Computer Science project titled “Bank Management System using Python and
MySQL” under my guidance.
This project is an original work and fulfills the requirements of the CBSE Class
XII Computer Science Practical Examination.
INTERNAL EXAMINER EXTERNAL EXAMINER
PRINCIPAL
ACKNOWLEDGEMENT
It is with pleasure that I acknowledge my sincere gratitude to our teacher, Mr.
Nitesh Sisodiya who taught and undertook the responsibility of teaching the
subject computer science. I have been greatly benefited from his classes. I am
especially indebted to our principal Mr. Ramesh Chandra Meena who has
always been a source of encouragement and support and without whose
inspiration this project would not have been a successful I would like to place
record heartfelt thanks to him. Finally, I would like to express my sincere
appreciation for all the other students for my batch their friendship & the fine
time that we all share together.
INDEX
S. No. Content
1 Certificate
2 Acknowledgement
3 Introduction
4 Problem Statement
5 Objectives of the Project
6 Scope of the Project
7 System Requirements
8 Tools & Technologies Used
9 Database Design
10 Project Design (Algorithm)
11 Source Code
12 Sample Output
13 Testing & Validation
14 Limitations
15 Conclusion
16 Future Enhancements
17 Bibliography
INTRODUCTION
Banks handle a large amount of customer data such as account details, balance information,
and transaction records.
Manual handling of these records is slow, error-prone, and insecure.
The Bank Management System is a Python-based application that automates basic banking
operations such as:
Opening new accounts
Depositing money
Withdrawing money
Viewing account details
Updating customer information
The project uses Python for logic and user interaction and MySQL for permanent data
storage.
PROBLEM STATEMENT
To design a computerized system that efficiently manages bank customer accounts and
transactions, reducing manual effort and improving accuracy.
OBJECTIVES
To automate basic banking operations
To store customer records permanently
To implement deposit and withdrawal operations
To use Python–MySQL connectivity
To apply database concepts in a real-life scenario
SCOPE OF THE PROJECT
Account creation and management
Balance inquiry
Deposit and withdrawal
Record update and deletion
Can be expanded into online banking system
SYSTEM REQUIREMENTS
Hardware
Computer / Laptop
4 GB RAM
Software
Windows / Linux
Python 3.x
MySQL Server
TOOLS & TECHNOLOGIES USED
Python
MySQL
MySQL Connector
IDLE / VS Code
DATABASE DESIGN
Table Name: accounts
Field Name Data Type
acc_no INT (Primary Key)
name VARCHAR
account_type VARCHAR
balance INT
phone VARCHAR
SOURCE CODE
# ============================================================
# BANK MANAGEMENT SYSTEM
# CLASS XII – CBSE COMPUTER SCIENCE PROJECT
# BASIC PYTHON + MYSQL CONNECTIVITY
# PROCEDURAL PROGRAM (NO OOPS)
# ============================================================
import [Link]
import sys
import time
# ------------------------------------------------------------
# UTILITY FUNCTIONS
# ------------------------------------------------------------
def pause():
input("\nPress Enter to continue...")
def line():
print("-" * 80)
# ------------------------------------------------------------
# DATABASE CONNECTION
# ------------------------------------------------------------
def connect_db():
try:
con = [Link](
host="localhost",
user="root",
password="root",
database="bank"
return con
except:
print("Database Connection Failed")
[Link]()
# ------------------------------------------------------------
# CREATE TABLE
# ------------------------------------------------------------
def create_table():
con = connect_db()
cur = [Link]()
[Link]("""
CREATE TABLE IF NOT EXISTS accounts(
acc_no INT PRIMARY KEY,
name VARCHAR(30),
acc_type VARCHAR(10),
balance INT,
phone VARCHAR(15)
""")
[Link]()
[Link]()
# ------------------------------------------------------------
# OPEN NEW ACCOUNT
# ------------------------------------------------------------
def open_account():
con = connect_db()
cur = [Link]()
print("\nOPEN NEW ACCOUNT")
line()
try:
acc = int(input("Enter Account Number: "))
bal = int(input("Enter Initial Balance: "))
except:
print("Invalid Input")
[Link]()
return
name = input("Enter Customer Name: ")
acc_type = input("Enter Account Type (Saving/Current): ")
phone = input("Enter Phone Number: ")
try:
[Link](
"INSERT INTO accounts VALUES (%s,%s,%s,%s,%s)",
(acc, name, acc_type, bal, phone)
[Link]()
print("Account Created Successfully")
except:
print("Account Number Already Exists")
[Link]()
pause()
# ------------------------------------------------------------
# DISPLAY ALL ACCOUNTS
# ------------------------------------------------------------
def display_accounts():
con = connect_db()
cur = [Link]()
[Link]("SELECT * FROM accounts")
data = [Link]()
print("\nALL BANK ACCOUNTS")
line()
if not data:
print("No Records Found")
else:
print("ACC_NO | NAME | TYPE | BALANCE | PHONE")
line()
for row in data:
print(row)
[Link]()
pause()
# ------------------------------------------------------------
# SEARCH ACCOUNT
# ------------------------------------------------------------
def search_account():
con = connect_db()
cur = [Link]()
try:
acc = int(input("Enter Account Number: "))
except:
print("Invalid Input")
[Link]()
return
[Link]("SELECT * FROM accounts WHERE acc_no=%s", (acc,))
data = [Link]()
if data:
print("\nACCOUNT DETAILS")
line()
print("Account No :", data[0])
print("Name :", data[1])
print("Type :", data[2])
print("Balance :", data[3])
print("Phone :", data[4])
else:
print("Account Not Found")
[Link]()
pause()
# ------------------------------------------------------------
# DEPOSIT MONEY
# ------------------------------------------------------------
def deposit():
con = connect_db()
cur = [Link]()
try:
acc = int(input("Enter Account Number: "))
amt = int(input("Enter Amount to Deposit: "))
except:
print("Invalid Input")
[Link]()
return
[Link]("SELECT balance FROM accounts WHERE acc_no=%s", (acc,))
data = [Link]()
if data:
new_bal = data[0] + amt
[Link]("UPDATE accounts SET balance=%s WHERE acc_no=%s",
(new_bal, acc))
[Link]()
print("Amount Deposited Successfully")
print("Updated Balance:", new_bal)
else:
print("Account Not Found")
[Link]()
pause()
# ------------------------------------------------------------
# WITHDRAW MONEY
# ------------------------------------------------------------
def withdraw():
con = connect_db()
cur = [Link]()
try:
acc = int(input("Enter Account Number: "))
amt = int(input("Enter Amount to Withdraw: "))
except:
print("Invalid Input")
[Link]()
return
[Link]("SELECT balance FROM accounts WHERE acc_no=%s", (acc,))
data = [Link]()
if not data:
print("Account Not Found")
elif amt > data[0]:
print("Insufficient Balance")
else:
new_bal = data[0] - amt
[Link]("UPDATE accounts SET balance=%s WHERE acc_no=%s",
(new_bal, acc))
[Link]()
print("Amount Withdrawn Successfully")
print("Remaining Balance:", new_bal)
[Link]()
pause()
# ------------------------------------------------------------
# UPDATE ACCOUNT DETAILS
# ------------------------------------------------------------
def update_account():
con = connect_db()
cur = [Link]()
try:
acc = int(input("Enter Account Number to Update: "))
except:
print("Invalid Input")
[Link]()
return
[Link]("SELECT * FROM accounts WHERE acc_no=%s", (acc,))
if not [Link]():
print("Account Not Found")
[Link]()
pause()
return
print("""
1. Update Name
2. Update Phone
""")
ch = int(input("Enter Choice: "))
if ch == 1:
name = input("Enter New Name: ")
[Link]("UPDATE accounts SET name=%s WHERE acc_no=%s",
(name, acc))
elif ch == 2:
phone = input("Enter New Phone: ")
[Link]("UPDATE accounts SET phone=%s WHERE acc_no=%s",
(phone, acc))
else:
print("Invalid Choice")
[Link]()
return
[Link]()
print("Account Updated Successfully")
[Link]()
pause()
# ------------------------------------------------------------
# DELETE ACCOUNT
# ------------------------------------------------------------
def delete_account():
con = connect_db()
cur = [Link]()
try:
acc = int(input("Enter Account Number to Delete: "))
except:
print("Invalid Input")
[Link]()
return
confirm = input("Confirm Deletion (y/n): ")
if [Link]() == 'y':
[Link]("DELETE FROM accounts WHERE acc_no=%s", (acc,))
[Link]()
print("Account Deleted Successfully")
else:
print("Deletion Cancelled")
[Link]()
pause()
# ------------------------------------------------------------
# BANK REPORT
# ------------------------------------------------------------
def bank_report():
con = connect_db()
cur = [Link]()
[Link]("SELECT COUNT(*) FROM accounts")
total = [Link]()[0]
[Link]("SELECT SUM(balance) FROM accounts")
money = [Link]()[0]
print("\nBANK REPORT")
line()
print("Total Accounts :", total)
print("Total Balance :", money)
[Link]()
pause()
# ------------------------------------------------------------
# MAIN MENU
# ------------------------------------------------------------
def main_menu():
create_table()
while True:
print("""
==================================================
BANK MANAGEMENT SYSTEM
==================================================
1. Open New Account
2. Display All Accounts
3. Search Account
4. Deposit Money
5. Withdraw Money
6. Update Account Details
7. Delete Account
8. Bank Report
9. Exit
==================================================
""")
try:
ch = int(input("Enter Choice: "))
except:
print("Invalid Input")
continue
if ch == 1:
open_account()
elif ch == 2:
display_accounts()
elif ch == 3:
search_account()
elif ch == 4:
deposit()
elif ch == 5:
withdraw()
elif ch == 6:
update_account()
elif ch == 7:
delete_account()
elif ch == 8:
bank_report()
elif ch == 9:
print("Thank You for Using Bank System")
break
else:
print("Invalid Choice")
# ------------------------------------------------------------
# PROGRAM START
# ------------------------------------------------------------
main_menu()
Sample Output
BANK MANAGEMENT SYSTEM
1. Open New Account
2. Display All Accounts
3. Search Account
4. Deposit Money
5. Withdraw Money
6. Update Account Details
7. Delete Account
8. Bank Report
9. Exit
Sample Output 2 – Open Account
Enter Account Number: 1001
Enter Initial Balance: 5000
Enter Customer Name: Amit Sharma
Enter Account Type: Saving
Enter Phone Number: 9876543210
Account Created Successfully
Sample Output 3 – Deposit
Enter Account Number: 1001
Enter Amount to Deposit: 2000
Amount Deposited Successfully
Updated Balance: 7000
Sample Output 4 – Withdraw
Enter Account Number: 1001
Enter Amount to Withdraw: 3000
Amount Withdrawn Successfully
Remaining Balance: 4000
Sample Output 5 – Search Account
ACCOUNT DETAILS
Account No : 1001
Name : Amit Sharma
Type : Saving
Balance : 4000
Phone : 9876543210
Sample Output 6 – Bank Report
BANK REPORT
Total Accounts : 1
Total Balance : 4000
Sample Output 7 – Exit
Thank You for Using Bank System
LIMITATIONS
The project handles only basic banking operations and does not support transactions
history.
Security features like encryption and password protection are not implemented.
The system is designed for single-branch use only.
No interest calculation is included for savings accounts.
CONCLUSION
This project enhanced my understanding of Python programming and database connectivity.
It helped me apply theoretical knowledge to a real-life problem.
FUTURE ENHANCEMENTS
Addition of transaction history and mini statement feature.
Implementation of secure login with PIN or OTP verification.
Support for multi-branch banking system.
Automatic interest calculation for savings and fixed deposits.
BIBLIOGRAPHY
NCERT Computer Science Textbook
Python Documentation
W3Schools