Bank Management System Project Class12
Bank Management System Project Class12
and MySQL
Name: [Your Name]
Class: XII
Session: 2024-25
Certificate
This is to certify that the investigatory project titled 'Bank Management System using
Python and MySQL' has been successfully completed by [Your Name], a student of Class XII,
during the academic year 2024–25. This project is submitted towards the partial fulfillment
of the requirements of the CBSE curriculum.
Signature of Teacher
Date: ____________
Acknowledgement
I would like to express my sincere gratitude to my Computer Science teacher for their
guidance and support throughout this project. I also thank my parents and friends for their
encouragement. This project would not have been possible without their help.
Index
1. Introduction
2. Objective
7. Learning Outcomes
8. Conclusion
9. Bibliography
1. Introduction
The Bank Management System is a software application developed using Python and
MySQL. It is designed to manage basic banking operations such as account creation, deposit,
withdrawal, and balance inquiry. The system offers a command-line interface for user
interaction.
2. Objective
To design and implement a Bank Management System that can perform essential banking
operations, providing a user-friendly interface using Python and integrating MySQL for data
management.
• MySQL
• mysql-connector-python
import mysql.connector
con = mysql.connector.connect(
host="localhost",
user="root",
password="your_password",
database="bank"
)
cursor = con.cursor()
def create_account():
acc_no = int(input("Enter Account Number: "))
name = input("Enter Name: ")
balance = float(input("Enter Initial Balance: "))
query = "INSERT INTO accounts (acc_no, name, balance) VALUES (%s, %s, %s)"
cursor.execute(query, (acc_no, name, balance))
con.commit()
print("Account created successfully.")
def deposit():
acc_no = int(input("Enter Account Number: "))
amount = float(input("Enter Deposit Amount: "))
cursor.execute("UPDATE accounts SET balance = balance + %s WHERE acc_no = %s",
(amount, acc_no))
con.commit()
print("Amount deposited successfully.")
def withdraw():
acc_no = int(input("Enter Account Number: "))
amount = float(input("Enter Withdrawal Amount: "))
cursor.execute("SELECT balance FROM accounts WHERE acc_no = %s", (acc_no,))
result = cursor.fetchone()
if result and result[0] >= amount:
cursor.execute("UPDATE accounts SET balance = balance - %s WHERE acc_no = %s",
(amount, acc_no))
con.commit()
print("Amount withdrawn successfully.")
else:
print("Insufficient balance or account not found.")
def check_balance():
acc_no = int(input("Enter Account Number: "))
cursor.execute("SELECT balance FROM accounts WHERE acc_no = %s", (acc_no,))
result = cursor.fetchone()
if result:
print(f"Current Balance: ₹{result[0]}")
else:
print("Account not found.")
def main():
while True:
print("\n--- Bank Management System ---")
print("1. Create Account")
print("2. Deposit Money")
print("3. Withdraw Money")
print("4. Check Balance")
print("5. Exit")
main()
7. Learning Outcomes
• Integration of Python with MySQL using connectors
• CRUD operations in SQL
8. Conclusion
The Bank Management System project helped in understanding how to connect Python
programs with databases. It also strengthened concepts of file handling, exception
management, and interactive programming.
9. Bibliography
• https://docs.python.org
• https://dev.mysql.com
• https://www.geeksforgeeks.org
• https://www.w3schools.com