Bank Management System-2
Bank Management System-2
________________
______________
Mrs. Nutan Parashar Mrs. Shalini
Arora
(PGT COMP. SC.) (PRINCIPAL)
ACKNOWLEDGMENT
I HAVE TAKEN EFFORTS IN THIS PROJECT.
HOWEVER, IT WOULD NOT BE POSSIBLE
WITHOUT THE KIND SUPPORT AND HELP OF
MANY INDIVIDUALS. I WOULD LIKE TO THANKS
MY PRINCIPAL, MRS. SHALINI ARORA FOR
PROVIDING ME THE LAB FACILITIES. I WOULD
ALSO LIKE TO THANK MY COMPUTER SCIENCE
TEACHER ,MR. NUTAN PARASHAR, FOR HER
INVALUABLE GUIDANCE WHICH HELPED ME TO
COMPLETE THIS PROJECT.I WOULD ALSO LIKE
TO THANKS MY PARENTS AND MY PROJECT
PARTNERS DEEPAK AND DARSH FOR
HELPING ME TO COMPLETE THIS PROJECT.
INDEX
S.NO TITLE
1) INTRODUCTION
2) SYSTEM DESIGN
3) SYSTEM DESCRIPTION
4) DATA DICTIONARY
5) PYTHON CODING
6) OUTPUT
7) SQL AT BACKEND
8) BIBLIOGRAPHY
9) NOTES
INTRODUCTION
IN THIS PROJECT I HAVE CREATED A “ATM
MANAGEMENT SYSTEM”. IT HELPS THE EMPLOYEE
AND THE CUSTOMER:-
1) TO KNOW ABOUT EVERY DETAILS IN THEIR
SYSTEM.
2)ALSO LET THE CUSTOMER KNOW ABOUT THE
DETAILS OF THEIR ACCOUNT.
3) ABOUT THEIR MONEY LEFT IN THEIR ACCOUNT AND
TO WITHDRAW THE MONEY FROM THEIR ACCOUNT.
4) IT WILL ALSO HELPS THE CUSTOMER AND EMPLOYEE
TO CREATE A NEW ACCOUNT AND TO CREATE A NEW
CUSTOMER.
5) IT WILL ALSO HELPS THE EMPLOYEE TO SEARCH
ABOUT A CUSTOMER DETAILS AND ACCOUNT DETAILS
OF A CUSTOMER.
6) IT WILL ALSO HELPS THE EMPLOYEE TO KNOW
ABOUT ALL THE CUSTOMER AND ACCOUNT DETAILS
WHICH ARE IN THEIR SYSTEM.
7) IT WILL ALSO HELPS THE USER TO DELETE AN
ACCOUNT DETAILS FROM THEIR SYSTEM.
8) IT WILL ALSO HELPS THE USER TO DELETE A
CUSTOMER DETAILS.
SYSTEM DESIGN
LOGIN
SCREEN
MAIN
MENU
CREATE A
CREATE A
NEW
ACCOUNT
USER
DISPLAY DISPLAY
ALL ALL
CUSTOMER ACCOUNT
SEARCH SEARCH AN
CUSTOMER ACCOUNT
DELETE A DELETE AN
CUSTOMER ACCOUNT
SYSTEM DESCRIPTION
IN THIS PROJECT WE HAVE USED PYTHON AS
WELL AS SQL TO CREATE AN “ATM
MANAGEMENT SYSTEM”. TO CONNECT
PYTHON WITH SQL WE HAVE USED
MYSQL.CONNECTOR WHICH HELPS US TO
LINK THE SQL TABLE WITH A PYTHON CODE.
TO CREATE A NEW USER AND CUSTOMER WE
HAVE USED CREATE TABLE AND INSERT
INTO TABLE VALUES() COMMAND. TO
SEARCH AN ACCOUNT AND CUSTOMER WE
HAVE USED SELECT * FROM TABLE WITH A
WHERE COMMAND AND TO DISPLAY ALL
ACCOUNT AND CUSTOMER WE HAVE USED
SELECT * FROM TABLES COMMAND AND TO
DELETE AN ACCOUNT AND CUSTOMER
DETAILS WE HAVE USED DELETE FROM
TABLE WITH A WHERE STATEMENT
COMMAND. WE HAVE ALSO CREATED SOME
FUNCTION TO NOT WRITE THE SAME CODE
AGAIN AND AGAIN. AND WE HAVE ALSO USED
SOME IF-ELSE STATEMENT TO CARRY OUT A
SPECIFIC STATEMENT.
DATA DICTIONARY
1) FUNCTION
i) mysqlConnection() :- to make the
connection between mysql and python.
ii) mysqlConnectionCheck():- to check the
connection between mysql and python.
iii)newCustomer() :- To create a new customer
and insert it information into table.
iv)displayAllCustomer() :- to display all the
customer record in table.
v)searchCustomer() :-To search a record of a
specific customer.
vi)newAccounnt():- To create a new account and
insert the record in the table.
vii)displayAllAccount():- To display all account
record in the table.
vii)searchAccount():- To search a record of a
specific account.
viii)withdrawAmount():- To withdraw money from a
specific account and update amount left in that
account.
ix)deleteCustomer():- To delete record of a specific
customer.
x)deleteAccount():- To delete record of a specific
account.
2) MODULES
i) mysql.connector :- To create a connection
between python and mysql.
3) KEYWORD
i)cid :- Customer ID
ii)userName
iii) password
iv) Cname :- Customer Name
v) Address:- customer address
vi) phone:- customer phone number
vii) account_no :- Customer account number
viii) account_type :- Customer account type
ix) amount :- Money in customer account
x) pin :- Atm pin of customer account
PYTHON CODING FOR
BANK MANAGEMENT SYSTEM
import mysql.connector as con
myConnection = ''
cursor = ''
userName = ''
password = ''
cid = ''
myConnection = con.connect(host =
"localhost",user=userName,password =
password,database = "ATM",auth_plugin =
'mysql_native_password')
if myConnection:
return myConnection
else:
print("\n ERROR ESTABLISHING MYSQL
CONNECTION!")
myConnection.close()
# To search A customer
def searchCustomer():
global cid
if myConnection:
cursor = myConnection.cursor()
cid = input("PLEASE ENTER CUSTOMER ID:")
sql = "Select * from customer where CID = %s"
value = (cid,)
data = cursor.execute(sql,value)
data = cursor.fetchall()
if data:
print("\n =======CUSTOMER
DETAILS=======")
print(data)
else:
print("SORRY! CUSTOMER NOT FOUND")
else:
print("\n SOMETHING WENT WRONG")
# To search an account
def searchAccount():
global cid
if myConnection:
cursor = myConnection.cursor()
cid = input("PLEASE ENTER CUSTOMER ID:")
account_no = int(input("PLEAASE ENTER ACCOUNT
NUMBER(0-9):"))
sql = "select * from account where CID = %s and
ACCOUNT_NO = %s"
value = (cid,account_no)
data = cursor.execute(sql,value)
data = cursor.fetchall()
if data:
print("\n =======CUSTOMER ACCOUNT
DETAILS=======")
print(data)
else:
print("SORRY! NO ACCOUNT INFORMATION
FOUND")
else:
print("\n SOMETHING WENT WRONG")
# To withdraw amount
def withdrawAmount():
count = 3
if myConnection:
cursor = myConnection.cursor()
account_no = int(input("PLEASE ENTER ACCOUNT
NUMBER(0-9):"))
sql = "select * from account where ACCOUNT_NO =
%s"
values= (account_no,)
data = cursor.execute(sql,values)
data = cursor.fetchall()
if data:
while True:
ATM_PIN = int(input("ENTER THE ATM
PIN(ONLY 3 ATTEMPTS ALLOWED):"))
sql = "select * from account where PIN = %s"
value = (ATM_PIN,)
cursor.execute(sql,value)
data = cursor.fetchall()
if data:
amount = int(input("PLEASE ENTER AMOUNT
TO WITHDRAW:"))
sql = "update ACCOUNT set AMOUNT =
AMOUNT - %s"
value = (amount,)
cursor.execute(sql,value)
cursor.execute("Commit")
print("=======TRANSACTION
SUCCESSFULLY COMPLETED=======")
break
else:
print("WRONG PIN! PLEASE ENTER VALID
PIN")
count = count - 1
print("YOU ARE LEFT WITH ONLY",
count ,"ATTEMPTS")
if count == 0:
print("YOUR CARD HAS BEEN BLOCKED")
break
else:
print("SORRY! ACCOUNT NOT FOUND")
# To delete an account
def deleteAccount():
global cid
if myConnection:
cursor = myConnection.cursor()
cid = input("PLEASE ENTER CUSTOMER ID:")
sql = "Select * from customer where CID =%s"
value = ( cid,)
data = cursor.execute(sql,value)
data = cursor.fetchall()
if data:
cursor = myConnection.cursor()
account_no = int(input("ENTER THE ACCOUNT
NUMBER:"))
sql = "delete from account where ACCOUNT_NO =
%s"
value = (account_no,)
cursor.execute(sql,value)
cursor.execute("Commit")
print("\n ACCOUNT DELETED SUCCESSFULLY!")
else:
print("SORRY! NO ACCOUNT FOUND")
else:
print("\n SOMETHING WENT WRONG!")
# Main Screen
myConnection = MYSQLconnectionCheck()
if myConnection:
MYSQLconnection()
while True:
print("\n
=======================================
=")
print("1. NEW USER")
print("2. DISPLAY ALL CUSTOMER")
print("3. SEARCH A CUSTOMER")
print("4. OPEN A NEW ACCOUNT")
print("5. DISPLAY ALL ACCOUNT")
print("6. SEARCH AN ACCOUNT")
print("7. WITHDRAW AMOUNT")
print("8. DELETE AN ACCOUNT")
print("9. DELETE A CUSTOMER")
print("10. EXIT")
print("\n
=======================================
=")
choice = int(input("ENTER YOUR CHOICE(1-10):"))
if choice == 1:
newCustomer()
elif choice == 2:
displayAllCustomer()
elif choice == 3:
searchCustomer()
elif choice == 4:
newAccount()
elif choice == 5:
displayAllAccounts()
elif choice == 6:
searchAccount()
elif choice == 7:
withdrawAmount()
elif choice == 8:
deleteAccount()
elif choice == 9:
deleteCustomer()
elif choice == 10:
break
else:
print("SORRY! MAY BE YOU ARE GIVING WRONG
INPUT")
else:
print("CHECK YOUR MYSQL CONNECTION FIRST!!!")
6) Search an account
7) Withdrawing money
SQL AT BACKEND
Database Tables in ATM
Structure of customer table
After withdrawing
BIBLIOGRAPHY
1. https://pythonclassroomdiary.in
2. https://xiipython.blogspot.com
3. https://www.mysql.com/
4. https://www.geeksforgeeks.org
5. https://pythonworld.in