Knowledge Guide
HomeDatabasesNormalization

Designing a Bank Management System

A Bank Management System (BMS) is a critical application used by banks to handle various services, such as managing customer accounts, processing transactions, managing loans, and overseeing employees. An effective database design ensures smooth operations, secure data handling, and efficient query execution.

In this case study, we’ll explore how to model a database for a Bank Management System (BMS) using Entity-Relationship (ER) diagrams and then map it to a relational database schema. By following this guide, you’ll gain the skills to design and implement a database for any banking system.

Requirements Analysis

Understanding the system's requirements is the first and most crucial step. It ensures that the database will support all necessary functionalities.

For our case study, let's outline the key functionalities that the HMS should support:

Step-by-Step ER Diagram Creation

We will build the ER diagram for the Hospital Management System through the following four steps.

Step 1: Identify Entities

Entities represent objects or concepts in the system that have data stored about them.

Primary Entities

  1. Customer
  2. Account
  3. Transaction
  4. Loan
  5. Loan_Repayment
  6. Branch
  7. Employee
  8. Card
Entities for Bank Management System
Entities for Bank Management System

Step 2: Detailing Attributes

We'll define attributes for each entity, including primary keys (PK) and foreign keys (FK).

1. Customer

2. Account

3. Transaction

4. Loan

5. Loan_Repayment

6. Branch

7. Employee

8. Card

Attributes for Bank Management System
Attributes for Bank Management System

Step 3: Defining Relationships

Let’s define the relationships between entities in the system.

1. Customer and Account

2. Account and Transaction

3. Account and Loan

4. Loan and Loan_Repayment

5. Customer and Card

6. Account and Card

7. Branch and Account

8. Branch and Employee

Here is the final ER diagram.

ER Diagram For Bank Management System
ER Diagram For Bank Management System

Mapping the ER Diagram to a Relational Schema

When converting the ER diagram into a relational schema for our Bank Management System, we need to carefully handle various components to ensure data integrity and optimal performance. Here are the key considerations:

Here is the Relational Schema diagram.

Relational Schema Diagram for the Bank Management System
Relational Schema Diagram for the Bank Management System

Now, let's translate the ER model into SQL tables.

1. Customer Table

CREATE TABLE Customer ( Customer_ID INT PRIMARY KEY, Full_Name VARCHAR(100), City VARCHAR(50), State VARCHAR(50), Area VARCHAR(50), Phone_Number VARCHAR(15), Email VARCHAR(50), Date_of_Birth DATE, Identification_Type VARCHAR(20), -- e.g., Passport, ID Card Identification_Number VARCHAR(50) );

2. Account Table

CREATE TABLE Account ( Account_ID INT PRIMARY KEY, Account_Type VARCHAR(20), -- e.g., Savings, Current Balance DECIMAL(10, 2), Date_Opened DATE, Branch_ID INT, Customer_ID INT, FOREIGN KEY (Branch_ID) REFERENCES Branch(Branch_ID), FOREIGN KEY (Customer_ID) REFERENCES Customer(Customer_ID) );

3. Transaction Table

CREATE TABLE Transaction ( Transaction_ID INT PRIMARY KEY, Transaction_Type VARCHAR(20), -- e.g., Deposit, Withdrawal Amount DECIMAL(10, 2), Transaction_Date DATE, Notes TEXT, Account_ID INT, FOREIGN KEY (Account_ID) REFERENCES Account(Account_ID) );

4. Loan Table

CREATE TABLE Loan ( Loan_ID INT PRIMARY KEY, Loan_Type VARCHAR(20), -- e.g., Home, Personal Loan_Amount DECIMAL(10, 2), Interest_Rate DECIMAL(5, 2), Start_Date DATE, End_Date DATE, Account_ID INT, FOREIGN KEY (Account_ID) REFERENCES Account(Account_ID) );

5. Loan_Repayment Table

CREATE TABLE Loan_Repayment ( Repayment_ID INT PRIMARY KEY, Repayment_Date DATE, Amount DECIMAL(10, 2), Loan_ID INT, FOREIGN KEY (Loan_ID) REFERENCES Loan(Loan_ID) );

6. Branch Table

CREATE TABLE Branch ( Branch_ID INT PRIMARY KEY, Branch_Name VARCHAR(50), Address VARCHAR(100), Phone_Number VARCHAR(15) );

7. Branch_Phone_Number Table

CREATE TABLE Branch_Phone_Number ( Branch_ID INT, Phone_Number VARCHAR(15), PRIMARY KEY (Branch_ID, Phone_Number), FOREIGN KEY (Branch_ID) REFERENCES Branch(Branch_ID) );

8. Employee Table

CREATE TABLE Employee ( Employee_ID INT PRIMARY KEY, Name VARCHAR(100), Role VARCHAR(50), Email VARCHAR(50), Branch_ID INT, FOREIGN KEY (Branch_ID) REFERENCES Branch(Branch_ID) );

9. Card Table

CREATE TABLE Card ( Card_ID INT PRIMARY KEY, Card_Type VARCHAR(20), -- e.g., Credit, Debit Expiry_Date DATE, Card_Limit DECIMAL(10, 2), Customer_ID INT, FOREIGN KEY (Customer_ID) REFERENCES Customer(Customer_ID) );

10. Account_Card Table

CREATE TABLE Account_Card ( Account_ID INT, Card_ID INT, PRIMARY KEY (Account_ID, Card_ID), FOREIGN KEY (Account_ID) REFERENCES Account(Account_ID), FOREIGN KEY (Card_ID) REFERENCES Card(Card_ID) );
🤖 Don't fully get this? Learn it with Claude

Stuck on Designing a Bank Management System? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.

🎨 Explain it visually

Build the mental picture, not memorization.

I just read a lesson on **Designing a Bank Management System** (Databases) and want to truly understand it. Explain Designing a Bank Management System from first principles using ONE vivid real-world analogy and a visual mental model — draw it as ASCII art or a clear step-by-step diagram — with a concrete example using real numbers. Then ask me one question to check I got the mental picture, and wait for my reply. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🤔 Walk me through it (interactive)

Socratic — adapts to where you're stuck.

Teach me **Designing a Bank Management System** interactively. Ask me ONE guiding question at a time, wait for my answer, and adapt to my confusion — build the idea with me step by step instead of explaining it all at once. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧪 Quiz me & fix my gaps

Active recall exposes what you missed.

Quiz me on **Designing a Bank Management System** with 5 questions, easy to tricky, ONE at a time. Tell me if each answer is right; at the end, explain clearly what I got wrong and why. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧠 Make it stick

Intuition + hook + flashcards for long-term memory.

Help me remember **Designing a Bank Management System** for the long term: give the one-sentence intuition, a memorable hook/mnemonic, a tiny worked example, and 3 active-recall flashcards (Q -> A). If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.

📝 My notes