π§βπ What is Degree of Relation?
The degree of a relationship refers to the number of entity sets (or tables) involved in a relationship.
It tells how many different entity types are connected together through a single relationship.
1οΈβ£ Unary Relationship (Degree 1)
A relationship that involves only one entity set, relating instances within the same set.
π Example:
An employee supervises another employee
Entity:
EmployeeRelationship:
Supervises
π ER Diagram:

2οΈβ£ Binary Relationship (Degree 2)
A relationship that involves two different entity sets.
πΉ This is the most common type of relationship.
π Example:
A student enrolls in a course
Entities:
Student,CourseRelationship:
Enrolls
π ER Diagram:

3οΈβ£ Ternary Relationship (Degree 3)
A relationship that involves three different entity sets.
π Example:
A doctor prescribes a medicine to a patient
Entities:
Doctor,Medicine,PatientRelationship:
Prescribes
π ER Diagram:

π§ Summary Table:
π’ Degree | π Meaning | π§Ύ Example |
|---|---|---|
Unary (1) | One entity related to itself | Employee supervises Employee |
Binary (2) | Two different entities involved | Student enrolls in Course |
Ternary (3) | Three different entities involved | Doctor prescribes Medicine to Patient |