Online Bank Management

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Motivation:

​ Practicality and Real-World Relevance: Banking and financial services are an


integral part of everyday life for individuals and businesses. Creating a bank
management system offers the opportunity to work on a project that has
direct real-world applications and serves a practical purpose.
​ Learning Opportunity: Developing a bank management system can be a highly
educational project. It allows developers to learn about various aspects of
software development, including user authentication, database management,
security, and transaction handling.

Introduction:

The code you provided represents a basic online bank management system
implemented using Python and MySQL. This system allows users to perform various
banking operations, including opening new accounts, depositing and withdrawing
money, checking account balances, displaying customer details, and closing
accounts.

Modules (based on code functions):

​ Open New Account (OpenAcc()):


● This module allows users to open a new bank account by providing
their name, account number, date of birth, address, contact number,
and opening balance.
● It inserts the provided data into the account and amount tables in the
MySQL database.
​ Deposit Amount (DepoAmo()):
● This module enables users to deposit money into their accounts.
● It updates the account balance in the amount table in the database.
​ Withdraw Amount (withdrawAmount()):
● Users can withdraw money from their accounts using this module.
● It also updates the account balance in the amount table.
​ Balance Enquiry (balEnq()):
● This module allows users to check their account balance by entering
their account number.
● It retrieves and displays the account balance from the amount table.
​ Display Customer Details (DisDetails()):
● Users can input their account number to view their account details
using this module.
● It retrieves and displays the customer's details from the account table.
​ Close An Account (closeAcc()):
● This module allows users to close their accounts.
● It deletes the associated data from both the account and amount tables
in the database.

Tech Stack (based on code):

● Programming Language: Python


● Database: MySQL
● Database Connectivity: mysql.connector library

Future Scope (based on code):

The provided code serves as a foundational structure for an online bank


management system. For future enhancements, you can consider:

​ Improving User Interface: Enhance the user interface to make it more


user-friendly and visually appealing.
​ Adding Error Handling: Implement robust error handling to ensure the system
handles unexpected situations gracefully.
​ Enhancing Security: Strengthen security measures, including input validation,
to protect against potential vulnerabilities.
​ Logging and Auditing: Implement logging and auditing features to track and
monitor system activities.
​ Scaling and Optimization: Optimize the code and database queries for better
performance and scalability.
​ Adding Advanced Features: Introduce advanced features like transaction
categories, monthly statements, and online statements.
​ Web Framework Integration: Consider integrating a web framework like Flask
or Django for a more structured and maintainable codebase.
​ Multi-User Support: Extend the system to support multiple users and sessions
simultaneously.

Uses: customer account management,fund transfers,loan management.

import mysql.connector

mydb=mysql.connector.connect(host="localhost",user="root",password="Vineeth@1
23",database="BANK_MANAGEMENT")

def OpenAcc():
n=input("Enter The Name:")

ac=input("Enter Account No:")

db=input('Enter The DOB:')

add=input("Enter Address:")

cn=int(input("Enter Contact No:"))

ob=int(input("Enter Opening Balance:"))

data1=(n,ac,db,add,cn,ob)

data2=(n,ac,ob)

sql1=("insert into account values (%s,%s,%s,%s,%s,%s)")

sql2=("insert into amount values (%s,%s,%s)")

x=mydb.cursor()

x.execute(sql1,data1)

x.execute(sql2,data2)

mydb.commit()

print("Data Enter Sucessfully........")

main()

def DepoAmo():

ac=input("Enter Account No:")

amount=int(input("Enter Amount To Deposit:"))

a="select balance from amount where accno=%s"

data=(ac,)

x=mydb.cursor()

x.execute(a,data)
result=x.fetchone()

t=result[-1]+amount

sql1 = ("update amount set balance=%s where Accno=%s")

d=(t,ac)

x.execute(sql1,d)

mydb.commit()

print("Amount deposited successfully")

main()

def withdrawAmount():

ac=input("Enter Account No:")

amount=int(input("Enter Amount To Withdraw:"))

a="select balance from amount where accno=%s"

data=(ac,)

x=mydb.cursor()

x.execute(a,data)

result=x.fetchone()

t=result[-1]-amount

sql1=("update amount set balance=%s where Accno=%s")

d=(t,ac)

x.execute(sql1,d)
mydb.commit()

print("Amount withdrawn succesfully")

main()

def balEnq():

ac=input("Enter Account No:")

a="select * from amount where AccNo=%s"

data=(ac,)

x=mydb.cursor()

x.execute(a,data)

result=x.fetchone()

print("Balance for account:",ac,"is",result[-1])

main()

def DisDetails():

ac=input("Enter Account No:")

a="select * from account where AccNo=%s"

data=(ac,)

x=mydb.cursor()

x.execute(a,data)

result=x.fetchone()

for i in result:

print(i)

main()
def closeAcc():

ac=input("Enter Account No:")

sql1="delete from account where accno=%s"

sql2="delete from amount where accno=%s"

data=(ac,)

x=mydb.cursor()

x.execute(sql1,data)

x.execute(sql2,data)

mydb.commit()

print("Account closed successfully")

main()

def main():

print('''

1.Open New Account

2.Deposit Amount

3.Withdraw

4.Balance Enquiry

5.Display Customer Details

6.Close An Account

''')

choice=input("Enter Task You Want To Perform:")


if(choice=='1'):

OpenAcc()

elif(choice=="2"):

DepoAmo()

elif(choice=="3"):

withdrawAmount()

elif(choice=="4"):

balEnq()

elif(choice=="5"):

DisDetails()

elif(choice=="6"):

closeAcc()

else:

print("Your Choice Is Wrong")

main()

main()

You might also like