DBMS Notes

Relationships in ER Model

In ER Model, a Relationship is a relation between entities. The Diamond symbol is use to represent the relationship between Entities.

Term Relationship Set

Relationship set is a set of same type of relationships in entity set. A relationship set may be strong or weak. Let explain both these terms,

I. Strong Relationship Set

  • A strong relationship exists in-between two strong entity sets.
  • Strong Relationship represents through a diamond symbol as below.

II. Weak Relationship Set

  • A weak relationship exists in-between the strong and weak entity set.
  • Representation of weak relationship is double diamond symbol.

Types of Relationships 

The Types of relationship are also known as cardinality of relationship or cardinality ratio. Types of relationship are explain below

1. One-to-One Relationship

When only one instance of an entity is attach with exact one entity instance of other entity in the relationship, then it will be one to one relationship.

For example: One Female can marry to only on Male

We can represent the above diagram as in following diagram

2. One-To-Many Relationship

When only one instance of the entity (i.e. Entity A) on the left side, and more than one instance of an entity (i.e. Entity B) on the right side are  associated with the relationship then it will be a one-to-many relationship.

For example: Scientist can invent many inventions, but invention is done by the only one scientist.

 Above diagram, Can be understand through the following diagram

3. Many-to-one relationship

When only one instance of the entity (i.e. Entity A) on the left side, and more than one instance of an entity (i.e. Entity B) on the right side are  associated with the relationship then it will be a one-to-many relationship.

For example: Student enrolls for only one School, but a School can have many students.

We can represent the above diagram as in following diagram

4. Many-to-Many Relationship

When more than one instances of the entity (i.e. Entity A) on the left side, and more than one instance of an entity (i.e. Entity B) on the right side are  associated with the relationship then it will be a many-to-many relationship.

For example: Projects can assign by many employees and employee can have many projects.

We can represent the above diagram as in following diagram

 Degree Of a Relationship Set

Total number of different entity sets which are participating in a relationship is known as degree of a relationship.

Types Of Degree of Relationships

1. Unary Relationship: When only ONE entity set participating in a relation, then that relation is known as unary relationship.

Example: one person is married to one person.

2. Binary Relationship: When TWO entities set are participating in a relationship then that relation is known as unary relationship.

Example: Student is enrolled in Course.

3. N-ary Relationship: when n-entities set participating in a relation, then such relationship is known as n-ary relationship.

4. Zero or none Relationship: When no instance of an entity (i.e. Entity A) is related to any instance of other entity (i.e. Entity B).

5. Recursive Relationship: It indicates a relationship of an entity to itself.

Cardinality and modality terms are also comes under relationships which we will cover in next lecture.

Help Other’s By Sharing…

Contact Us

Burewala, Vehari, Punjab, Pakistan

cstaleem1@gmail.com

Website: CStaleem.com

Pin It on Pinterest