×

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

Sys Module in Python

What are Modules? The Modules are the kind of files that contain Python statements and definitions. The module is known by the name of the file followed by the suffix “.py”....

5 minutes read.

Yield Statement In Python

The generators are defined by using the yield statement in Python. Generally, it converts a normal Python function into a generator.  The yield statement hauls the function and returns back the...

2 minutes read.

Commands in Python

In this tutorial, we will see some of the widely used python commands along with their syntaxes and examples. To make Python more user-friendly, developers have provided these commands to...

12 minutes read.

Python object()

Python object() class The object class in Python is a base for all classes. It returns a new featureless object. Syntax class object Parameter NA Return It returns a new featureless object. Example 1 # Python program explaining # the object()...

1 minute read.

Python Not Equal Operator

Python provides us with many operators to make tasks easier. There are about 7 categories of operators in Python. One of the 7 classifications is the comparison operators. Just as...

3 minutes read.

Python try catch exception

The try-except proclamation can deal with exceptions. Exceptions might happen when you run a program. Exceptions are blunders that occur during the execution of the program. Python won't educate you regarding...

3 minutes read.

OS Module in Python

What is a module? The Modules are the kind of files that contains python statements and definitions. The module is known by the name of the file followed by the suffix...

8 minutes read.

Python SciPy Library

Introduction SciPy, a logical library for Python is an open-source, BSD-authorized library for arithmetic, science, and design. The SciPy library relies upon NumPy, which gives advantageous and quick N-dimensional exhibit control....

6 minutes read.

Python BS4 Code

Python BS4 Code The BS4 stands for BeautifulSoup version 4.x. The BeautifulSoup is a Python library which is used for pulling out data of the HTML & XML files using the...

14 minutes read.

Python and its advantages

What is Python? Python is an object-oriented programming language, a general-purpose programming language with a high level, and also an interpreted language that has an easy syntax and dynamic semantics. Python...

7 minutes read.

The Calendar Module of Python

The calendar module provides calendar features, including printing functions for a specific month or year. Default is the first day of the week on Monday and the last day on Sunday...

3 minutes read.

XGBoost for Regression in Python

Regression problem results real values. Decision Trees and Linear Regression are regularly used regression algorithms and use some metrics involved in regression like mean squared error and root mean squared...

5 minutes read.

Python String Negative Indexing

This page contains all the information how to use “Negative indexing“ in Python with the help of using slicing. What is an Index? An index is a numeric value, which is assigned...

3 minutes read.

What is Python 2

Python is a widely used high-level language. The initial work on developing python was begun in the late 1980s. In 1989, Guido Van Rossum started to work on it. Initially,...

3 minutes read.

How to check the version of the Python Interpreter?

As we all know what an interpreter is, and how important it is. We should also be aware of the fact that it is important to have knowledge of the...

2 minutes read.

How to implement classifiers in Python

What is classification? Classification is a type of supervised machine learning problem with a categorical target (response) variable. Given the known label in the training data, the classifier approximates a mapping...

4 minutes read.

Python sorted() function

Python sorted() function The sorted() function returns a sorted list of the specified iterable object. Syntax sorted(iterable, *, key=None, reverse=False) Parameter iterable: It is a required parameter that represents the sequence to sort, list, dictionary, tuple etc. key:...

1 minute read.

How to Sort a String in Python?

The characters in the string are sorted or put in alphabetical order using the sort string function in Python. Python has built-in techniques for sorting strings available. Since we occasionally...

6 minutes read.

Spotify API in Python

The application programming interface is referred to as API. In essence, an API serves as a layer of communication or, as the name suggests, an interface that enables systems to...

3 minutes read.

Convert Float to Int in Python using Pandas

Introduction To play with huge amounts of data, in python we require a tool. The tool which is available in Python is pandas. A panda is an open-source library. It is...

4 minutes read.