Cardinality

Relationships are rarely one-to-one
For example, a manager usually manages more than one employee
This is described by the cardinality of the relationship, for which there are four possible categories.
One to one (1:1) relationship
One to many (1:m) relationship
Many to one (m:1) relationship
Many to many (m:n) relationship
On an ER diagram, if the end of a relationship is straight, it represents 1, while a
"crow's foot" end represents many.

A one to one relationship - a man can only marry one woman, and a woman can only marry one man, so it is a one to one (1:1) relationship
A one to may relationship - one manager manages many employees, but each employee only has one manager, so it is a one to many (1:n) relationship
A many to one relationship - many students study one course. They do not study more than one course, so it is a many to one (m:1) relationship
A many to many relationship - One lecturer teaches many students and a student is taught by many lecturers, so it is a many to many (m:n) relationship

0 comments