0% found this document useful (0 votes)
2 views

Project Code

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Project Code

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

INDEX

S.no Title Page no


1. Certificate
2. Acknowledgement
3. Bank Management System
4. Source Code
5. Output
6. SQL Tables
7. Bibliography
Bank Management System

The Bank Management System (BMS) is a web-based application used


for paying financial institutions for the services they provide to the
Bureau of the Fiscal Service. BMS also provides analytical tools to
review, and approve compensation, budgets, and outflows.
Bank Management System is used for solving financial applications of a
customer in banking environment in order to nurture the needs of an
end banking user by providing various ways to perform banking tasks.
Also to enable the user’s workspace to have additional functionalities
which are not provided under a conventional banking project.

The objective of a bank management system is to efficiently and


effectively manage various banking operations, processes, and
resources to ensure smooth functioning of the bank while providing
excellent services to customers.
Some key objectives include:
 Customer Service: Ensuring customer satisfaction by providing
convenient and reliable banking services, including account
management, transactions, loans, and customer support.
 Risk Management: Identifying, assessing, and mitigating various
risks such as credit risk, operational risk, market risk, and
compliance risk to safeguard the bank's assets and reputation.
 Operational Efficiency: Streamlining processes and utilizing
resources effectively to optimize operational efficiency, reduce
costs, and improve profitability.
 Information Security: Implementing robust security measures to
protect sensitive customer information, prevent fraud, and ensure
data integrity and confidentiality.
 Strategic Planning: Developing and implementing strategic plans
to achieve long-term goals, such as expanding market presence,
increasing profitability, and enhancing competitiveness.
 Technology Integration: Leveraging technology and innovative
solutions to automate processes, enhance customer experience,
and stay competitive in the digital banking landscape.
 Financial Performance: Maximizing financial performance by
managing assets and liabilities effectively, optimizing revenue
streams, and controlling expenses.
Source code
1)setup.py
This is for creating database and table.
import mysql.connector as sql

conn = sql.connect(host='localhost', user='root',


passwd='who1are2you3', database='bank')
if conn.is_connected():
print('Connected successfully to the database')

cur = conn.cursor()

cur.execute('''
CREATE TABLE IF NOT EXISTS customer_details (
account_no INT PRIMARY KEY,
account_name VARCHAR(25),
phone_no INT,
address VARCHAR(50),
gender VARCHAR(10),
age INT,
credit_amount FLOAT
)
''')
2)login.py
This is for employee login
import mysql.connector as sql

conn = sql.connect(host='localhost', user='root',


passwd='who1are2you3', database='bank')
cur = conn.cursor()

print("--- USER AUTHENTICATION ---")


print("1. Register")
print("2. Login")
choice = int(input("Enter your choice: "))

if choice == 1:
username = input("Enter a Username: ").strip()
password = input("Enter a Password: ").strip()

cur.execute('''CREATE TABLE IF NOT EXISTS


user_table (
username VARCHAR(25) PRIMARY KEY,
password VARCHAR(25) NOT NULL
)''')

try:
cur.execute("INSERT INTO user_table (username,
password) VALUES (%s, %s)", (username, password))
conn.commit()
print("User Registered Successfully!")
except sql.errors.IntegrityError:
print("Username already exists. Please try
another one.")

elif choice == 2:
username = input("Enter Your Username: ").strip()
password = input("Enter Your Password: ").strip()

cur.execute("SELECT * FROM user_table WHERE


username = %s AND password = %s", (username, password))
user = cur.fetchone()

if user is None:
print("Invalid Username or Password")
else:
print("Login Successful!")
import menu1

else:
print("Invalid Choice. Exiting...")
3)menu1.py
This is the main program which contains all functions of the Bank
Management System. It contains functions such as Adding, Deleting,
Editing and Transaction.

import mysql.connector as sql

conn = sql.connect(host='localhost', user='root',


passwd='who1are2you3', database='bank')
cur = conn.cursor()
conn.autocommit = True

while True:
print("\n--- BANK MENU ---")
print("1. Create Bank Account")
print("2. Transaction")
print("3. Customer Details")
print("4. Transaction Details")
print("5. Edit Account Details")
print("6. Delete Account")
print("7. Quit")

choice = int(input("Enter your choice: "))

if choice == 1:
account_no = int(input("Enter your Account
Number: "))
account_name = input("Enter your Account Name:
")
phone_no = int(input("Enter your Phone Number:
"))
address = input("Enter your Address: ")
gender = input("Enter your Gender: ")
age = int(input("Enter your Age: "))
credit_amount = float(input("Enter your Credit
Amount: "))

query = f"INSERT INTO customer_details VALUES


({account_no}, '{account_name}', {phone_no},
'{address}', '{gender}', {age}, {credit_amount})"
cur.execute(query)
print("Account Created Successfully!")

elif choice == 2:
account_no = int(input("Enter Your Account
Number: "))
cur.execute(f"SELECT * FROM customer_details
WHERE account_no = {account_no}")
account_data = cur.fetchone()

if account_data is None:
print("Invalid Account Number. Try Again.")
else:
print("1. Withdraw Amount")
print("2. Add Amount")
transaction_choice = int(input("Enter your
choice: "))

if transaction_choice == 1:
amount1 = float(input("Enter Withdrawal
Amount: "))
cur.execute(f"UPDATE customer_details
SET credit_amount = credit_amount - {amount1} WHERE
account_no = {account_no}")
print("Amount Withdrawn Successfully!")

elif transaction_choice == 2:
amount2 = float(input("Enter Amount to
Add: "))
cur.execute(f"UPDATE customer_details
SET credit_amount = credit_amount + {amount2} WHERE
account_no = {account_no}")
print("Amount Added Successfully!")

elif choice == 3:
account_no = int(input("Enter Your Account
Number: "))
cur.execute(f"SELECT * FROM customer_details
WHERE account_no = {account_no}")
account_data = cur.fetchone()

if account_data is None:
print("Invalid Account Number")
else:
print(f"\nAccount Number:
{account_data[0]}\nAccount Name: {account_data[1]}\
nPhone Number: {account_data[2]}\nAddress:
{account_data[3]}\nGender: {account_data[4]}\nAge:
{account_data[5]}\nCredit Amount: {account_data[6]}")

elif choice == 4:
try:
account_no = int(input("Enter Your
Account Number: "))
cur.execute(f"SELECT * FROM
customer_details WHERE account_no = {account_no}")
account_data = cur.fetchone()
if account_data is None:
print("Invalid Account Number")
else:
print("Amount added :",amount2)
print("Amount Withdrawn :",amount1
except:
print()
elif choice == 5:
account_no = int(input("Enter Your Account
Number to Edit: "))
cur.execute(f"SELECT * FROM customer_details
WHERE account_no = {account_no}")
account_data = cur.fetchone()
if account_data is None:
print("Invalid Account Number")
else:
print("1. Edit Account Name")
print("2. Edit Phone Number")
print("3. Edit Address")
print("4. Edit Gender")
print("5. Edit Age")
edit_choice = int(input("Enter your choice:
"))

if edit_choice == 1:
new_name = input("Enter New Account
Name: ")
cur.execute(f"UPDATE customer_details
SET account_name = '{new_name}' WHERE account_no =
{account_no}")
elif edit_choice == 2:
new_phone = int(input("Enter New Phone
Number: "))
cur.execute(f"UPDATE customer_details
SET phone_no = {new_phone} WHERE account_no =
{account_no}")
elif edit_choice == 3:
new_address = input("Enter New Address:
")
cur.execute(f"UPDATE customer_details
SET address = '{new_address}' WHERE account_no =
{account_no}")
elif edit_choice == 4:
new_gender = input("Enter New Gender:
")
cur.execute(f"UPDATE customer_details
SET gender = '{new_gender}' WHERE account_no =
{account_no}")
elif edit_choice == 5:
new_age = int(input("Enter New Age: "))
cur.execute(f"UPDATE customer_details
SET age = {new_age} WHERE account_no = {account_no}")

print("Account Details Updated


Successfully!")

elif choice == 6:
account_no = int(input("Enter Your Account
Number to Delete: "))
cur.execute(f"DELETE FROM customer_details
WHERE account_no = {account_no}")
print("Account Deleted Successfully!")

elif choice == 7:
print("Thank you for using the banking system.
Goodbye!")
break

else:
print("Invalid Choice. Try Again.")
Output
--- USER AUTHENTICATION ---
1. Register
2. Login
Enter your choice: 2
Enter Your Username: Abhi123
Enter Your Password: 12345
Login Successful!

Creating Accounts:

--- BANK MENU ---


1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 1
Enter your Account Number: 101
Enter your Account Name: Abhijeet
Enter your Phone Number: 2345678901
Enter your Address: Ghaziabad
Enter your Gender: M
Enter your Age: 27
Enter your Credit Amount: 85000
Account Created Successfully!

--- BANK MENU ---


1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 1
Enter your Account Number: 102
Enter your Account Name: Aarya
Enter your Phone Number: 9999999900
Enter your Address: Delhi
Enter your Gender: M
Enter your Age: 25
Enter your Credit Amount: 785000
Account Created Successfully!
--- BANK MENU ---
1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 1
Enter your Account Number: 103
Enter your Account Name: Vanshika
Enter your Phone Number: 2580258025
Enter your Address: Jaipur
Enter your Gender: F
Enter your Age: 22
Enter your Credit Amount: 50000
Account Created Successfully!

--- BANK MENU ---


1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 1
Enter your Account Number: 104
Enter your Account Name: Gargi
Enter your Phone Number: 1234567890
Enter your Address: Mumbai
Enter your Gender: F
Enter your Age: 45
Enter your Credit Amount: 900000
Account Created Successfully!

--- BANK MENU ---


1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 1
Enter your Account Number: 105
Enter your Account Name: Raghav
Enter your Phone Number: 2316547895
Enter your Address: Delhi
Enter your Gender: M
Enter your Age: 22
Enter your Credit Amount: 10000
Account Created Successfully!

--- BANK MENU ---


1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 3
Enter Your Account Number: 103

Account Number: 103


Account Name: Vanshika
Phone Number: 2580258025
Address: Jaipur
Gender: F
Age: 22
Credit Amount: 50000.0

--- BANK MENU ---


1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 2
Enter Your Account Number: 10
Invalid Account Number. Try Again.

--- BANK MENU ---


1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 2
Enter Your Account Number: 101
1. Withdraw Amount
2. Add Amount
Enter your choice: 1
Enter Withdrawal Amount: 50000
Amount Withdrawn Successfully!

--- BANK MENU ---


1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 2
Enter Your Account Number: 104
1. Withdraw Amount
2. Add Amount
Enter your choice: 2
Enter Amount to Add: 750000
Amount Added Successfully!

--- BANK MENU ---


1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 5
Enter Your Account Number to Edit: 102
1. Edit Account Name
2. Edit Phone Number
3. Edit Address
4. Edit Gender
5. Edit Age
Enter your choice: 3
Enter New Address: New York
Account Details Updated Successfully!

--- BANK MENU ---


1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 6
Enter Your Account Number to Delete: 105
Account Deleted Successfully!
--- BANK MENU ---
1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 4
Enter Your Account Number:101
Amount Withdrawn :50000
SQL TABLES
1.Table before transaction:-

2.Table after transaction:-


3.Table after editing:-

4.Table after Deletion:-


Acknowedgement

I would like to express my heartfelt gratitude to all those who contributed to the
successful completion of my project, "Bank Management System."
First and foremost, I am deeply thankful to my Computer Science teacher, Ms
Venkatalakshmi , for their invaluable guidance, encouragement, and support
throughout the project. Their expertise and insights have been instrumental in
shaping this work.
I am also grateful to my school, Ryan International School for providing me with
the necessary resources and infrastructure to complete this project effectively.
A special thanks to my parents and friends for their unwavering support and
encouragement during this endeavor.
This project has not only enhanced my technical skills in Python and SQL but has
also given me a deeper understanding of real-world banking operations and the
importance of database management.
Finally, I extend my gratitude to everyone who directly or indirectly supported me
in completing this project.

You might also like