ER Model : DBMS

DBMS Tutorial



[fblike]

ER Model : Introduction

  • ER Model is and Entity Relationship Model. It means, a model which is used to describe and define overall structure of any database by using schematic and diagrammatic representation. ER Model defines the logic of database.
  • The schematic and diagrammatic representation is generated using certain components including entity, attributes, relationships etc. These components are discussed in the next section.

ER Model : Components

  • The components of entity relationship model are the building blocks which helps in the generation of an ER Model diagram, which finally results in the design of logical structure of a database. There are three basic components of Entity Relationship Model. These are discussed below.
  • All these components have definite diagrammatically representations which are used for generation of ER Diagram. Let’s discuss them in detail now.    

 

This image describes the various components of ER model used in generation of er diagram in dbms.

ER Model : Components

 

1. Entity

  • An entity can be called as the basic object which represents the ER Model. It can be a real world object/thing present physically or can be an object/thing present logically/virtually. Entities are the objects or things or articles or pieces that have a existence without any dependence on any other object.

For example : Bank account can be an entity, Loan can be an entity, Bank branch can be an entity etc. These entities have their own properties which are known as attributes.

 

2. Attribute

  • Once the entities are defined, their properties support them and are known as the attributes. These attributes also consists of specific values corresponding to the type of entity they are related with. Attributes describes the properties and characteristics of the entity.

For example : Attributes of Bank account (Which is an entity) can be “ Account No, Account Holder Name, Balance etc.”. Also, values of attributes are domain specific. It means, if account is an entity then balance cannot be negative. There exists six types of attributes for specific types of entities.

 

a) Simple Attribute : Simple attribute are those attributes which cannot be divided further because of their atomic nature.

Let’s make it clear with an example. The Account number of a customer can be a simple attribute as it cannot be divided further. Date of birth of a person is another example of simple attribute.

b) Composite Attribute : Composite attributes are those attributes which are the combination of two or more than two simple attributes joined together.

For example : Name of a customer of account holder can be a composite attribute.

Ganesh + Dutt + Upreti → First Name + Middle Name + Last Name {Composite Attributes}

c) Derived Attribute : Derived Attributes are those attributes whose values are derived from the already stored attributes in the database.

For example : Database consisting of height of a class. Then value of average height can be derived from the already available data of students.

d) Single Valued Attribute : Single valued attribute are those which contains only a single specified value or a single unique value.

For example : Aadhar Number, SSN No etc.

e) Multi Valued Attribute : Multi-valued attributes are those which can have multiple value against them.

For example : Address, email, Phone number are multi-valued attributes.

f) Null Value Attribute : Null value attributes are those which can be left blank without passing any value.

For example : A person can have a name without middle name and hence middle name field can be left blank or null.

Ganesh + Upreti → First Name + _______ + Last Name

 

3. Relationship

  • Relationship is the third and last component of the ER Model. It is responsible for establishing a link of communication between attributes and entities as per requirements.
  • For example : “Has ancan be termed as a relationship between a customer and an account in bank.

 

This image describes the relationship components used in generation of er diagram in dbms.

ER Model : Relationship

 

  • Relationship can be categorized into three majors :
    • Binary Relationship : When any relationship is established among 2 entities, it is called binary relationship.
    • Ternary Relationship : When any relationship is established among 3 entities, it is called ternary relationship.
    • n-Degree Relationship : When any relationship is established among any number of entities(2 or more than two), then n is replaced with that number. For example : 2-Degree, 3-Degree, 4-Degree etc.