Skip to content
Home » Type of relationship

Type of relationship

Below is a clean, complete, and exam-oriented explanation of the Types of Relationships in the ER (Entity–Relationship) Model


TYPES OF RELATIONSHIPS IN ER MODEL

A relationship in an ER model represents how two or more entities are associated with each other.
The types of relationships are mainly classified by degree (number of participating entities) and cardinality (minimum/maximum participation).

We cover both categories.


I. TYPES OF RELATIONSHIP BASED ON DEGREE

The degree of a relationship indicates how many entities participate in that relationship.


1. Unary Relationship (Recursive Relationship)

A relationship between entities of the same type.

✔ Entity relates to itself
✔ Used for hierarchical or recursive structures

Examples:

  • Employee manages Employee
  • Person married_to Person

Diagram:

+----------+
| Employee |
+----------+
     |
   manages
     |
+----------+
| Employee |
+----------+

2. Binary Relationship

A relationship between two different entities.
This is the most common type.

Examples:

  • Student enrolls in Course
  • Customer places Order
+---------+     Enrolls     +--------+
| Student | ---------------  | Course |
+---------+                  +--------+

3. Ternary Relationship

A relationship between three entities.

Examples:

  • Supplier supplies Product to Project
  • Doctor treats Patient in Hospital
 Supplier ----\
               \    
                >---- Supplies ---- Project
Product  ------/

4. Higher-Degree (N-ary) Relationship

A relationship involving more than three entities.

✔ Rare in real-world databases
✔ Usually converted into binary relationships


II. TYPES OF RELATIONSHIPS BASED ON CARDINALITY (MAPPING CONSTRAINTS)

Cardinality defines the number of instances of one entity that can be associated with another entity.

These are MOST IMPORTANT for exam questions.


1. One-to-One (1:1) Relationship

Each entity in set A can relate to only one entity in set B, and vice versa.

Examples:

  • Each citizen has one passport
  • Each employee has one company vehicle

Diagram:

Citizen (1) -------- (1) Passport

2. One-to-Many (1:M) Relationship

One entity in set A can be associated with many entities in set B.
But each entity in B relates to only one in A.

Examples:

  • One department has many employees
  • One teacher teaches multiple students

Diagram:

Department (1) ------< (M) Employee

3. Many-to-One (M:1) Relationship

Reverse of 1:M.

Examples:

  • Many students belong to one department
  • Many employees report to one manager

Diagram:

Student (M) >------ (1) Department

4. Many-to-Many (M:N) Relationship

Entities in A can be related to many in B, and vice versa.

Examples:

  • Students enroll in many courses
  • Courses have many students
  • Customers buy many products

Diagram:

Student (M) ------< Enrolls >------ (N) Course

Note: In relational databases, an M:N relationship is converted into a composite (associative) entity.


III. PARTICIPATION CONSTRAINTS

Participation describes whether relationship participation is mandatory or optional.


1. Total Participation (Mandatory)

Every entity must participate in the relationship.

Example:
Each employee must belong to a department.

Symbol: Double line


2. Partial Participation (Optional)

Some entities may or may not participate.

Example:
A customer may or may not place an order.

Symbol: Single line


FULL SUMMARY (Exam Friendly)

Relationship types are classified as:

A) Based on Degree

  1. Unary – relationship within the same entity
  2. Binary – between two entities (most common)
  3. Ternary – among three entities
  4. N-ary – more than three entities

B) Based on Cardinality

  1. 1:1 – Citizen ↔ Passport
  2. 1:M – Department → Employees
  3. M:1 – Students → Department
  4. M:N – Students ↔ Courses

C) Based on Participation

  1. Total Participation (mandatory)
  2. Partial Participation (optional)

Perfect 5-Mark Answer

The ER model supports different types of relationships:

  • Unary (recursive): entity relates to itself.
  • Binary: between two entities; most common.
  • Ternary: among three entities.
  • Cardinality types include 1:1, 1:M, M:1, and M:N relationships.
  • Participation may be total or partial.
    These help accurately model real-world associations between entities.