Bank Management System
Bank Management System
INDEX
Sr. No Particular
1 Brief overview of project
2 Software and hardware requirement
3 Structure of the tables
4 Source code of project
5 Output screening
6 Bibliography
SOFTWARE SPECIFICATION:-
Operating System : Windows 7
Platform : Python IDLE 2.7
Database : MySQL
Languages : Python
HARDWARE SPECIFICATION:-
DBMS: The software required for the management of data is called as DBMS.
It has3 models:
• Relation model
• Hierarchical model
• Network model
structure of a tables:
python code:
source code:
import random
import datetime
def change_password():
mycon=mysql.connector.connect(host="localhost",user="root",password="root",d
atabase="bankmgnt")
cur=mycon.cursor()
while(True):
cur.execute(qry)
data=cur.fetchall()
print(data)
if data[0][1]==pwd:
cur.execute(qry)
mycon.commit()
break
if cho.lower()=='n':
break
mycon.close()
def account_balance():
mycon=mysql.connector.connect(host="localhost",user="root",password="root",d
atabase="bankmgnt")
cur=mycon.cursor()
cur.execute(qry)
data=cur.fetchone()
if data==None:
print("invalid input")
else:
work_done="check_balance"
cur.execute(qry)
mycon.commit()
def deposit():
mycon=mysql.connector.connect(host="localhost",user="root",password="root",d
atabase="bankmgnt")
cur=mycon.cursor()
cur.execute(qry)
data=cur.fetchone()
if data==None:
print("invalid input")
else:
work_done="deposit"
cur.execute(qry)
mycon.commit()
cur.execute(qry)
mycon.commit()
def withdraw():
mycon=mysql.connector.connect(host="localhost",user="root",password="root",d
atabase="bankmgnt")
cur=mycon.cursor()
data=cur.fetchone()
if data==None:
print("invalid input")
else:
work_done="withdraw"
cur.execute(qry)
mycon.commit()
cur.execute(qry)
mycon.commit()
def transfer_fund():
mycon=mysql.connector.connect(host="localhost",user="root",password="root",d
atabase="bankmgnt")
cur=mycon.cursor()
cur.execute(qry)
data=cur.fetchone()
if data==None:
print("invalid input")
else:
work_done="Fund transfer"
try:
cur.execute(qry)
mycon.commit()
cur.execute(qry)
mycon.commit()
cur.execute(qry)
mycon.commit()
except:
print("error in transaction")
def CREATE_ACCOUNT():
mycon=mysql.connector.connect(host="localhost",user="root",passwd="root",dat
abase="bankmgnt")
cur=mycon.cursor()
name=input("Customer Name:")
gender=input("Gender:m/f")
address=input("Address:")
data=cur.fetchone()
print(data)
if data[0]==None:
custid=9876
else:
custid=data[0]+1
cur.execute(qry)
data=cur.fetchone()
print(data)
if data[0]==None:
account_no=123456789
else:
account_no=data[0]+1
cur.execute(qry)
mycon.commit()
password=name[:4]+gender+str(random.randint(1000,10000))
cur.execute(qry)
mycon.commit()
cur.execute(qry)
mycon.commit()
def UPDATE_ACCOUNT():
mycon=mysql.connector.connect(host="localhost",user="root",passwd="root",dat
abase="bankmgnt")
cur=mycon.cursor()
data=cur.fetchone()
if data==None:
print("invalid input")
else:
if cho==1:
if acc_type=="saving":
acc_type="current"
else:
acc_type="saving"
cur.execute(qry)
else:
cur.execute(qry)
mycon.commit()
def DELETE_ACCOUNT():
mycon=mysql.connector.connect(host="localhost",user="root",passwd="root",dat
abase="bankmgnt")
cur=mycon.cursor()
cur.execute(qry)
data=cur.fetchone()
if data==None:
print("invalid input")
else:
cur.execute(qry)
mycon.commit()
cur.execute(qry)
mycon.commit()
def SEARCH_ACCOUNT():
mycon=mysql.connector.connect(host="localhost",user="root",passwd="root",dat
abase="bankmgnt")
cur=mycon.cursor()
cur.execute(qry)
data=cur.fetchone()
if data==None:
print("invalid input")
else:
print(data)
mycon.commit()
def VIEW_ALL_ACCOUNT():
print("\n*******ACCOUNT DETAILS********\n")
mycon=mysql.connector.connect(host="localhost",user="root",passwd="root",dat
abase="bankmgnt")
cur=mycon.cursor()
data=cur.fetchall()
for i in data:
print(i)
import mysql.connector
mycon=mysql.connector.connect(host="localhost",user="root",passwd="root",dat
abase="bankmgnt")
mycursor=mycon.cursor()
while True:
if choice==1:
while(True):
if cho==1:
CREATE_ACCOUNT()#ok
elif cho==2:
UPDATE_ACCOUNT()
elif cho==3:
DELETE_ACCOUNT()#ok
elif cho==4:
SEARCH_ACCOUNT()#ok
elif cho==5:
VIEW_ALL_ACCOUNT()#ok
elif cho==6:
break
else:
elif choice==2:
mycon=mysql.connector.connect(host="localhost",user="root",password="root",d
atabase="bankmgnt")
cur=mycon.cursor()
while(True):
flag=0
cur.execute(qry)
data=cur.fetchall()
print(data)
if data[0][1]==pwd:
while(True):
choice=int(input("1-account_balance\n2.deposit\n3.withdraw\
n4.transfer_fund\n5.change_password\n6 exit"))
if choice==1:
account_balance()#ok
elif choice==2:
deposit()#ok
elif choice==3:
withdraw()#ok
elif choice==4:
transfer_fund()#ok
elif choice==5:
change_password()#ok
else:
flag=1
break
else:
break
if flag==1:
break
elif choice==3:
break
output screen
enter the account number123456791
1-account_balance
2.deposit
3.withdraw
4.transfer_fund
5.change_password
6 exit1
1-account_balance
2.deposit
3.withdraw
4.transfer_fund
5.change_password
6 exit4
1-account_balance
2.deposit
3.withdraw
4.transfer_fund
5.change_password
6 exit1
invalid input
1-account_balance
2.deposit
3.withdraw
4.transfer_fund
5.change_password
6 exit1
1-account_balance
2.deposit
3.withdraw
4.transfer_fund
5.change_password
6 exit
BIBLIOGRAPHY
1. http://www.google.com/
2. http://en.wikipedia.org
by Sumita Arora