Holi Offer - Use Code HOLI24

Register Now

The Entity-Relationship Model (ER Model) - DBMS

Published on Thursday, January 21, 2016
Hi Folks, 
Continuing with DBMS, we'll take up ER model today. Introduction article on DBMS can be found at Introduction to DBMS

==>> This article is a part of PK Series (IT)

Queries will be handled in comments section.

ER Model

ER model is a data model for describing the data or information, visually, as a collection of entities and relationships. It was developed by Peter Chen in 1976. The symbols and notations used in ER model are as follows:
ER Model



Components of ER Diagram

E-R Diagram has 3 main components:

1. Entity

Entity is a thing in the real world with an independent existence, and entity set is a collection of all entities of particular entity type in the database. E.g. Employees of a company can be defined as entities and employees have same attributes can be put under an entity set. All entities have some attributes that give them identity.

2. Attribute

An attribute describes a property or characteristic of an entity. E.g. Name, age , address can be attributes of an employee. Types of attributes are discussed below:
  • Simple attribute- Its an atomic value which can not be divided further. E.g employee's phone number. 
  • Key Attribute - it represents main characteristic of an entity. It is used to represent primary key. 
  • Composite Attribute - An attribute can have its own attributes as well. E.g. Address attribute is usually composed of city, state and zip code attributes. 
  • Derived attribute - These attributes don't exist in the physical database and their values are derived from other 

3. Relationship

A relationship describes relations between entities. 3 types of relationships exist between entities:

a) Binary Relationship:  is a relationship between 2 separate entities or entity sets. It is further of 3 types:

  • One to One: Let's say one student can enroll only in one course and one course will only have one student. This type of relationship is rarely seen in real world. 

  • One to Many - As per this relationship, one student can enroll to many courses but one course will have one student only. Example might sound weird but this is for explanation purpose.
         
ER Model
  • Many to One - As per this, a student can enroll for one course only but a course can have many students.
ER Model
  • Many to Many - As per this, many students can enroll for more than one course. 
     
ER Model

b) Recursive Relationship: is when an entity is related with itself. E.g. each employee has a manager in a organization which is further managed by a manager. Thus an employee manages other 
employees and is managed by some employee as well. 
DBMS

c) Ternary Relationship: is when three entities participate in a relationship i.e relationship of degree three. E.g A university might maintain data about which teacher taught which subjects under which course. 

Keys

Key is an attribute or a collection of attributes that uniquely identifies an entity. Various types of keys are discussed below:
  • Super key - a set of attributes ( one or more ) that collectively identifies an entity
  • Composite key- a key requiring more than one attribute
  • Candidate key - a minimal super key is called candidate key. An entity set may have more than one candidate key. 
  • Primary key - the candidate key chosen to be used for identifying entities and accessing records. Key by default means primary key. 
  • Alternate key - a candidate key not used for primary key
  • Secondary key - attribute or set of attributes commonly used for accessing records but not necessarily unique
  • Foreign key - is a tern used in relational databases (not ER model) for an attribute that is primary key of another table and is used to establish a relationship with that table

Quote of the day

Success is the sum of small efforts, repeated day in and day out.  - Rober Collier

                        
                                                                                                                                           Deepak A
ebook store

About us

ramandeep singh

Ramandeep Singh is a seasoned educator and banking exam expert at BankExamsToday. With a passion for simplifying complex concepts, he has been instrumental in helping numerous aspirants achieve their banking career goals. His expertise and dedication make him a trusted guide in the journey to banking success.

  • Follow me:
Close Menu
Close Menu