Loading

Entity Relationship Diagram


Entity Relationship diagram or ER diagram is a type of graphical or visual representation, which is used to represent entity relationship model(ER model). An ER model is generally used to represent and perceive the facts and aspects needed in a business, to perform a business process. It is used to represent the relationship or association between the entities stored in the database of a system.

ER diagram should not be misinterpreted as a flowchart diagram due to its structure. A flowchart is used to represent the algorithm work flow in a diagrammatic form, whereas the chief purpose of ER diagram is to define and visualize the logical structure of a database. Moreover, the symbols and shapes used in the ER diagram are used to depict some special object or purpose in comparison to a flowchart diagram.

Its components

Basically, three elements are involved in the constitution of an ER diagram. These are

Entity

Entity

An entity may be any person, place, thing, action or concept in respect to whom, information or data is to be stored. In ER diagram, entity is being shown in the rectangular boxes.

Attributes

Attributes

These are the properties or traits possessed by the entities, which may be define and describe. Each of the ellipse representing only one attribute is connected or linked to its respective entity. They are shown in ellipse shape.

Depending upon certain qualities & aspects, attributes may further be classified into 3 forms. These are

Composite attribute:

Attribute which may further be extended or branched, is known as composite attribute. For example,

Composite Attribute

Multi-valued attribute:

Attribute which possess or store more than one value is called multi-valued attribute. These are represented by the double ellipse shape. For example,

Multivalued Attributes

Derived attribute:

Attribute which is derived or may be inferred from the other attribute, falls under the category of derived attribute. It is shown by the dashed ellipse shape. For example

Derived Attributes

ThinkSys Advertisement
ThinkSys Advertisement

Relationship

Represented by the diamond shape box, it is used to define the link or association or relationship, between different entities.

Relationship

Relationships may also be classified into following forms:

Binary relationship:

It is the linking between the two entities. Based on the cardinality and ordinality, following relationship prevails in the binary relationship.

One to One Relationship

One customer may have 1 bank account only.

One to Many Relationship

One customer may have N number of bank accounts.

Many to Many Relationship

N number of customers may have N number of accounts.

Many to One Relationship

N number of customers may have 1 bank account only.

Recursive Relationship:

It involves linking the entity to itself. For example,

Recursive Relationship

As we see, a student monitors the students.

Example:

ER Diagram

In the given E-R diagram, we have 5 entities, namely, Student, College, Computer Science, Mechanical, and Electronics.

Here, an entity, student having 4 attributes(Name, gender, Date of Birth, Age) including one derived attribute, enrolls(relationship) in a college named entity having 3 attributes namely, name, affiliation, address, which is specialized in(relationship) Computer Science, Mechanical and Electronics(3 entities).



Advertisement:

ThinkSys Advertisement


LP

App development ad thinksys

Devops