ER diagram for banking system
This ER diagram models a simple banking system with five tables: branches, customers, accounts, transactions and loans. It shows how customers hold accounts at branches, how money movements are recorded, and how loans are tracked. It suits students learning database design and developers starting a banking schema.

Example: ER diagram for banking system: click to open it in the editor and change it.
Entities and key attributes
| Entity | Primary key | Key attributes |
|---|---|---|
| branches | id | name, ifsc, city |
| customers | id | name, pan, phone |
| accounts | id | customer_id (FK), branch_id (FK), type, balance |
| transactions | id | account_id (FK), amount, type, created_at |
| loans | id | customer_id (FK), amount, rate, status |
Money fields such as balance, amount and rate use DECIMAL, which avoids rounding errors. created_at is a TIMESTAMP, so every transaction has an exact time.
Relationships and cardinality
- customers 1 : N accounts: one customer can own many accounts, and each account points to one customer through customer_id.
- branches 1 : N accounts: a branch holds many accounts, and each account belongs to one branch through branch_id.
- accounts 1 : N transactions: every deposit or withdrawal links to a single account through account_id.
- customers 1 : N loans: a customer can take several loans, and each loan has one borrower through customer_id.
accounts is the central table. It joins customers to branches and collects all transactions.
How to adapt it for your project
- Add a cards or employees table and link it to accounts or branches with a new foreign key.
- For transfers between accounts, add a second account reference to transactions, such as from and to account IDs.
- If loans are issued by a specific branch, add a branch_id foreign key to loans.
- Swap pan and ifsc for your country's tax ID and bank routing code.
- For joint accounts, replace customer_id in accounts with a link table such as account_holders. That turns the relationship into N : M.
Tip: Do not trust the stored balance alone. You can check it by summing the transactions for that account. If you store both, update them inside a single database transaction so they never drift apart.
Frequently asked questions
What are the entities in an ER diagram for a banking system?
This diagram has five entities: branches, customers, accounts, transactions and loans. Each one has an INT id as its primary key.
What is the relationship between customer and account in a banking ER diagram?
It is one-to-many. One customer can have many accounts, and each account stores a single customer_id foreign key.
How are transactions linked in the banking system ER diagram?
Each transaction has an account_id foreign key pointing to accounts. One account can have many transactions, each with an amount, a type and a created_at timestamp.
Make your own ER diagram with AI →