E-R Diagram in DBMS | Introduction to ER Model

An entity–relationship model (ER model) describes the structure of a database with the help of a diagram, which is known as Entity Relationship Diagram. It is commonly known as an ER Diagram. ER diagram shows the relationship among entity sets. 

An ER diagram pictorially explains the relationship between entities to be stored in a database.


An ER diagram has three main components:

1. Entity

2. Attribute

3. Relationship


Entity: 

An entity is an object or component of data. Entities are represented by rectangle. All table of database are treat as entity. Consider an organization as an example, employee, department, product  etc. can be taken as an entity.


Attributes:

An attribute describes the property of an entity. For example, Roll_No, Name, DOB, Address are the attributes which defines entity type Student.

Attributes are represented by ellipses. Every ellipse represents one attribute and is directly connected to its entity (rectangle).


Relationship: 

A relationship is used to describe the relation between entities. A relationship is represented by diamond shape in ER diagram. Name of the relationship is written inside the diamond-box. All the entities (rectangles) participating in a relationship, are connected to it by a line.


There are four types of cardinal relationships:

1. One to One

2. One to Many

3. Many to One

4. Many to Many

 


Symbols Used in ER Diagrams:


Rectangle: Represents Entity sets.

Ellipses: Represents Attributes

Diamonds: Represents Relationship Set

Lines: It links attributes to Entity Sets and Entity sets to Relationship Set

Double Ellipses: Represents Multivalued Attributes

Dashed Ellipses: Derived Attributes

Double Rectangles: Weak Entity Sets

Double Lines: Total participation of an entity in a relationship set





Why Use ER Diagrams in DBMS?

  • ER Diagram helps us conceptualize the database and lets us know which fields need to be embedded for a particular entity
  • ER Diagram gives a better understanding of the information to be stored in a database
  • It reduces complexity and allows database designers to build databases quickly
  • It helps to describe elements using Entity-Relationship models
  • It allows users to get a preview of the logical structure of the database




Post a Comment

0 Comments