The number of occurrences in one entity, which is correlated with the times of events in another entity defines the degree of relationship.
There is a three degree of relationship:
- One-to-one (1:1)
- One-to-many (1: M)
- Many-to-many (M: N)
- According to the One-to-one relationship, anyone occurrence in the entity is related to exclusively one occurrence in other entity.
- However, One-to-one relationship is not commonly seen in practice.
- For instance, if an employee is provided a vehicle by the company, then the vehicle shall be only driven by the respective employee.
- Hence, the vehicle of the company and employee is sharing a one-to-one relationship.
- One-to-many occurrence refers to one occurrence in any entity that is related to many incidents in other entity.
- For instance, Any employee works in any one department. However, any department can have various employees.
- Hence, the employee and department have a one-to-many relationship.
- Many-to-many degree of relationship refers to the various occurrences in any entity which relates to many other phenomena in another entity.
- Many-to-many degree of relationship is similar to a one-to-one relationship. Many-to-many relationship hardly exists in a system.
- For instance, an employee can do work on various projects. Any project can have a large team of multiple employees.
- Hence, project and employee maintain a many-to-many relationship.