×

ER diagram of the Bank Management System in python

What is an ER diagram?

The full form of the ER diagram is the Entity Relationship diagram. This diagram is used in database management systems to have a rough idea of the relations between the entities present in a database system.

Entity generally means any real-life object which has attributes, and the entity may or may not exist physically in the real world. For example, a person, student, etc. are the entities that exist in this physical world, but bank accounts, etc., only exist logically. Attributes are the general properties of that entity by which we can distinguish it from other entities. One attribute can be common between more than one entity.

For example, a student entity has attributes like a school name, and a teacher entity also has the same attribute as a school name.

To draw the entity relationship diagram for any system, we have to identify each entity and its attributes. Also, we have to identify the relationship of a particular entity with other entities.

We will also have to determine the type of attributes and type of relationship between entities and then draw the diagram.

For a bank management system, let’s consider a scenario where a bank has lots of accounts and lots of customers. One bank has many branches with their unique branch number. Each account also has a unique account number, and there is also a loan account.

Let us identify the entity and its attributes in a bank system:

1. Bank

It is an entity where it has attributes like bank name, head branch address, starting date of establishment etc. bank has their unique code. So, unique code can be used as primary key.

2. Branch

As we know, one bank has a lot of branches, and we can consider one branch as the entity of the bank system. One branch can be attributes like branch name, branch address, branch code (IFSC code), etc. branch code or IFSC code is unique, so it is primary key.

3. Account

One branch has many bank accounts. Each account has many properties like an account number (unique), date of account opening, account balance, type of account, etc. account number is the attribute that more than one account cannot have the same account number so that we can use it as the primary key for this entity.

4. Customer

A bank can serve a lot of customers. It is necessary that every person who has an account in the bank is a customer. Many people can be the customer of the bank, and each customer can have the customer id, customer name, phone number, address, etc. customer id for each customer is different, so it's a primary key.

5. Loan

The loan is also an entity as a bank issues loans to specific customers, and for a loan, there are a lot of properties attached to it like loan account number, loan amount, type of loan (home loan/student loan, etc.), date of the loan, maximum years of the loan, etc. Loan account number is different for different accounts so it will work here as the primary key.

Let us discuss the relationships between different entities:

1. Bank and branch

It is an easy relationship that 1 bank has many branches, but 1 branch cannot have many banks. So it is a 1 to N relationship.

2. Branch and account

One branch has a lot of accounts, and 1 account cannot exist in multiple branches. So it is also a 1 to N relationship.

3. Branch and Loan

One specific branch issues many loans, but one loan will not have multiple branches, so it is also a 1 to N relationship.

4. Loan and customer

One loan can be issued to many customers (joint account loan), and one customer can have many loans. So, it is like an M to N relationship.

5. Account and customer

One account can be held by more than one customer (joint account), and one person can have multiple accounts in the same branch. So it is also many to many, or we can say M to N relationship between these entities.

For drawing the ER diagram of any system, we should know that each entity will be represented by a rectangle box, and each relationship between two entities will be represented by a diamond-shaped box. Different attributes of an entity will be represented by circular shapes.

Let’s draw the ER diagram of the bank management system:

ER diagram of the Bank Management System

Related Topics

Python Namespace

In python, the namespace is a very important concept that should be understood before using any function or variables. When we write code, we often use variables, libraries, functions, modules, etc....

4 minutes read.

What is the Python Global Interpreter Lock?

Introduction When working with processes, Python employs a form of process lock called the Global Interpreter Lock (GIL). Python typically executes a collection of typed statements using just one thread. It...

4 minutes read.

Python Basics

In this tutorial, we will learn about the basics of Python, a very famous programming language. This tutorial will help you understand the language better if you start with python....

8 minutes read.

Notepad++ For Python

In this article, you are going to learn what notepad++ is and how it is integrated with python to use the python programming language. You can also learn how to...

4 minutes read.

How to Substring a String in Python

String Unicode characters collection is referred to as a String. It consists of a succession of characters, including alphanumeric and special characters. Substring: Core Concept A substring is a piece of a string....

5 minutes read.

Filter List in Python

Python: Python is one of the most used programming languages, as it is used widely in software and data analysis, web development, etc. It is said to be a user-friendly programming...

3 minutes read.

Unit Testing in Python

The process of testing whether a particular unit is working properly or not is called “UNIT TESTING”. A unit test will check small components in your application. The first and...

7 minutes read.

Python program to find factorial of a given number

Python program to find factorial of a given number Factorial is a non-negative integer. It is the product of all positive integers from 1 to the number we are going to...

3 minutes read.

Comment starts with the symbol in Python

Python programming language: Python is an interactive and more accessible language than any other programming language. The python programming language uses a variety of libraries to perform the operations in a...

3 minutes read.

Python frozenset()

Python frozenset() class The frozenset() class in Python returns a new frozenset object, optionally with elements taken from iterable. Syntax class frozenset([iterable]) Parameter iterable: This parameter represents an iterable object, like list, set, tuple etc. Return This class returns an unchangeable...

1 minute read.

Add in Dictionary Python

Dictionary in python: Dictionaries are a useful data configuration for storing information in Python because they can mimic real-world data arrangements where a particular value exists for a particular key. The...

4 minutes read.

Python Algorithms

A quote goes, "A goal without a plan is just a wish." To achieve anything in life, we can't simply go for it without making a plan and sticking to...

4 minutes read.

Python NewLine

In python, a new line character denoted by "\n" is known as an escape character or escape sequence, and it will force the cursor to change its position to the next...

6 minutes read.

Front end in python

Python : Python is an object oriented programming language which is highly interpreted and is highly interactive. Python was created by Guido van Rossum in the year 1985 – 1990 .The...

4 minutes read.

How to append an Array in Python

A group of objects kept at adjacent memory regions is known as an array. It is a container with a set capacity for a certain number of things, all of...

7 minutes read.

Python Skyline

Python Programming Language: Python is an interactive and more accessible language than any other programming language. The python programming language uses a variety of libraries to perform the operations in a...

3 minutes read.

Magento 2 Site optimization

Magento 2 Site optimization Magento 2 is a CMS, commonly referred to as Intensive efficiency. Improving the speed and reliability of your Magento 2 app helps clients to achieve a better user experience while...

2 minutes read.

Python Time Library

We will consider various functions given by the python module library with examples.This python time module helps to work on time in python to get the current time.Before going with...

4 minutes read.

Performing Transaction Using Python MySQL

Transaction A Transaction contains a set of SQL commands used to change the data in the dataset. If we say transaction, it means that the data in the database has changed....

3 minutes read.

Python Unit Test Cheat String

Python: Python is an interactive and more accessible language than any other programming language. The python programming language uses a variety of libraries to perform the operations in a faster way....

3 minutes read.