100% found this document useful (2 votes)
9K views22 pages

Computer Science Project Report: (PYTHON AND MYSQL Connectivity) Bank Management System

This document is a project report for a Bank Management System created using Python and MySQL. It includes an introduction describing the project, libraries used such as tabulate and mysql connector, coding snippets showing functions like registering a new account, displaying account details, depositing and withdrawing money. It also includes outputs of running the code and a bibliography section. The project allows managing bank accounts using files by allowing operations like adding new accounts, viewing account details, modifying accounts, and depositing or withdrawing funds.

Uploaded by

manyaarora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
9K views22 pages

Computer Science Project Report: (PYTHON AND MYSQL Connectivity) Bank Management System

This document is a project report for a Bank Management System created using Python and MySQL. It includes an introduction describing the project, libraries used such as tabulate and mysql connector, coding snippets showing functions like registering a new account, displaying account details, depositing and withdrawing money. It also includes outputs of running the code and a bibliography section. The project allows managing bank accounts using files by allowing operations like adding new accounts, viewing account details, modifying accounts, and depositing or withdrawing funds.

Uploaded by

manyaarora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

COMPUTER SCIENCE

PROJECT REPORT
[PYTHON AND MYSQL Connectivity ]
BANK MANAGEMENT SYSTEM
SUBMITTED BY

NAME : CLASS XII ROLL NO.

SESSION : 2020-21
CERTIFICATE
This is to certify that

Master Roll No

of school namehave successfully completed their Computer


Project entitled

“ BANK
MANAGEMENT
SYSTEM ”
as per the requirement of CBSE.

Signature of Signature of Signature of

Internal Examiner Principal External Examiner


ACKNOWLEDGEMENT
It gives us great pleasure and deep satisfaction in presenting
the project towards the fulfillment of practical knowledge in
Python and MYSQL.

We would like to express our sincere gratitude to several


people with whose help and encouragement, we have been able to
complete this project successfully.

We would like to thank Teacher name, our Computer


Science teacher, for his guidance, valuable suggestions and
continuous encouragement which led to the accomplishment of
this project. We wish to put our deepest sense of appreciation and
thanks to him. We express our deepest gratitude to Principal
name school name, for his continuous guidance and motivation
and also for extending all the necessary facilities required which
led to the accomplishment of this project.

We are also very grateful to our parents for their constant and
loving support. Finally, we also wish to express a word of thanks
to all our friends and all those directly or indirectly involved in our
project for their help and cooperation.
TABLE OF CONTENTS

 Certificate

 Acknowledgement

 Introduction

 Imported libraries and their purpose

 Coding & outputs

 Bibliography
INTRODUCTION

This is an automated software system written in Python


programming language for Bank Management which can handle
accounts for customers. It uses files to handle the daily transactions
and account management. It is not complete accounting software
however it can manage the accounts of the customers using the files.
It has a nice graphical layout written in Python Language.

It can add new accounts and edit the existing ones and it also
helps in viewing the details of the customer either by name or by
their account number. It helps in the deposition or withdrawal of
money from an account and also helps in modifying the incorrect
data of an account of the customer and closing an account.Also to
create KYC a person need to enter either of following documents-
Voting Id Card, Aadhar Number,Driving License,Pan Card.
LIBRARIES USED AND
THEIR PURPOSE

1. tabulate – for displaying the details in the


tabular format

2. mysql connector – for developing a


connection between mysql databases and
python programming language
CODING
# Project On Bank Management System By XII

from tabulate import tabulate


import mysql.connector
con=mysql.connector.connect(host='localhost',
username='root',
password='root')
cur=con.cursor()
cur.execute("create database if not exists ALLINDIABANK")
print("Database created successfully..")
cur.execute("use ALLINDIABANK")
cur.execute("create table if not exists ACCOUNT_REGISTRY(accno int primary key not
null,name char(15) not null,username varchar(10) not null,acctype varchar(10) not
null,balance int,age int,kyc varchar(20))")
print("Table created successfully..")
while True:
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
print('Press 1 for Registering a new bank account ')
print('Press 2 for Displaying all the Accounts Details')
print("Press 3 Display an Account")
print("Press 4 Delete Accounts details")
print("Press 5 Delete an Account ")
print("Press 6 Modify an Account")
print("Press 7 Deposit money")
print("Press 8 Withdraw money")
print("Press 9 for updating or adding KYC details")
print("Press 0 Exit")
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
choice=int(input("Option :- "))
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
if choice==1:
try:
print('Fill these details to register your account')
accno=int(input("enter account no:-"))
name=input("Enter name :- ")
username=input('Enter username :')
acctype=input('Enter account type :- ')
balance=int(input('Enter balance :- '))
age=int(input('Enter age :- '))
kyc='not done'
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
value=(accno,name,username,acctype,balance,age,kyc)
query="insert into ACCOUNT_REGISTRY values(%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query,value)
con.commit()
print("Record added successfully")
except:
print("some error in adding")
elif choice==2:
try:
query="select * from ACCOUNT_REGISTRY "
cur.execute(query)
detail=cur.fetchall()
print(tabulate(detail,tablefmt="psql"))
except:
print("Error in Displaying details")
elif choice==3:
try:
no=input("Enter Account Number to Display")
query="select * from ACCOUNT_REGISTRY where accno="+no
cur.execute(query)
myrecord=cur.fetchone()
print("Record of Account number :"+no)
print(myrecord)
c=cur.rowcount
if c==-1:
print("Account not found ")
except:
print("Error in Displaying account details")
elif choice==4:
try:
ch=input("Do you want to delete All Records (Y/N)")
if ch=='Y':
query="truncate table ACCOUNT_REGISTRY"
cur.execute(query)
con.commit()
print(" All Records Deleted")
except:
print("Error in Deleting Records")
elif choice==5:
try:
no=input("Enter Account Number to Delete")
query="delete from ACCOUNT_REGISTRY where accno="+no
cur.execute(query)
con.commit()
c=cur.rowcount
if c>=0:
print("account Deleted ")
except:
print("Error in Deleting record")
elif choice==6:
try:
no=input("Enter Account Number to Modify")
query="select * from ACCOUNT_REGISTRY where accno= "+no
cur.execute(query)
myrecord=cur.fetchone()
c=cur.rowcount
if c==-1:
print("Account Number "+no+" does not exist")
else:
name=myrecord[1]
typ=myrecord[3]
username=myrecord[2]
bal=myrecord[4]
ag=myrecord[5]
print(type(myrecord[5]))

print("AccNO : ",myrecord[0])
print("NAME : ",myrecord[1])
print("USERNAME : ",myrecord[2])
print("AccType : ",myrecord[3])
print("Balance : ",myrecord[4])
print("AGE : ",myrecord[5])

print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
print("ENTER THE NEW VALUE FOR CHANGE OR JUST LEAVE AND PRESS
ENTER")
x=input("Enter new name or leave")
if len(x)>0:
name=x
y=input("Enter new Account Type or leave ")
if len(y)>0:
typ=y
z=input("Enter new username or leave")
if len(z)>0:
username=z
b=input("Enter new age or leave")
if len(b)>0:
ag=int(b)
query='update ACCOUNT_REGISTRY set
name='+"'"+name+"'"+','+'acctype='+"'"+typ+"'"+','+'username='+"'"+username+"'"+'
,'+' age='+str(ag)+' where accno=' +no
print(query)
cur.execute(query)
con.commit()
print("details modified")
except Exception as e:
print("error in modifying")
print(e)

elif choice==7:
try:
no=input("Enter Account Number ")
query="select * from ACCOUNT_REGISTRY where accno= "+no
cur.execute(query)
myrecord=cur.fetchone()
c=cur.rowcount
if c==-1:
print("Account Number "+no+" does not exist")
else:
amount=int(input("Enter amount to deposit"))
bal=amount+int(myrecord[4])
query='update ACCOUNT_REGISTRY set balance=%s where '+\
'accno=%s'
rec=(bal,no)

cur.execute(query,rec)
con.commit()
print("Amount Deposited in account no",no)
except:
print("error in Depositing Amount")
elif choice==8:
try:
no=input("Enter Account Number ")
query="select * from ACCOUNT_REGISTRY where accno= "+no
cur.execute(query)
myrecord=cur.fetchone()
c=cur.rowcount
if c==-1:
print("Account Number "+no+" does not exist")
else:
amount=int(input("Enter amount to withdraw"))
if amount<myrecord[4]:
bal=int(myrecord[4])- amount
if bal>1000:
query='update ACCOUNT_REGISTRY set balance=%s where '+\
'accno=%s'
rec=(bal,no)
cur.execute(query,rec)
con.commit()
print("Amount Withdrawn")
else:
print("insufficient balance so cant withdraw ")
else:
print("amount to be withdrawn greater than your balance available")
except:
print("error in Withdrawing Amount")

elif choice==9:
no=input("Enter Your Account Number")
query="select * from ACCOUNT_REGISTRY where accno= "+no
cur.execute(query)
myrecord=cur.fetchone()
c=cur.rowcount
if c==-1:
print("Account Number "+no+" does not exist")
else:
if myrecord[6]=='not done':
print('For KYC you need to provide details from one of these government id')
print('Press 1 for Aadhar Card')
print('Press 2 for Voter Id Card')
print('Press 3 for Pan Card')
print('Press 4 for Driving License')
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
cho=int(input("Enter your choice :- "))
if cho==1:
ad=int(input("Aadhar Number :- "))
cur.execute('update ACCOUNT_REGISTRY set kyc='+str(ad)+' where '+\
'accno='+no)
con.commit()
print("KYC Done")
elif cho==2:
vi=int(input("Voter Id Number :- "))
cur.execute('update ACCOUNT_REGISTRY set kyc='+str(vi)+'
where '+\
'accno='+no)
con.commit()
print("KYC Done")
elif cho==3:
pc=int(input("Pan Card Number :- "))
cur.execute('update ACCOUNT_REGISTRY set kyc=+'+str(pc)+'
where '+\
'accno='+no)
con.commit()
print("KYC Done")
elif ch==4:
dl=int(input("Driving License Number :- "))
cur.execute('update ACCOUNT_REGISTRY set kyc='+str(dl)+'
where '+\
'accno='+no)
con.commit()
print("KYC Done")
else:
print('Wrong Choice')
else:
print("kyc already done")
elif choice==0:
break
OUTPUTS
1. INITIAL SCREEN

2. D
A
T
A
B
A
S
E
AND TABLE CREATION
3. ADD RECORD
4. SEARCH RECORD
5. DISPLAY ALL RECORD

6.
6.
6.
6.
MODIFY RECORD
7. DELETE RECORD
8. DEPOSIT MONEY

9. WIT
HD
RA
W
MONEY
10. ADD KYC
THANK YOU !!!
BIBLIOGRAPHY

COMPUTER SCIENCE WITH PYTHON BY :–


SUMITA ARORA

WEBSITES :- www.icbse.com

You might also like