Entity Relationship Model
A representative model to visualize how Database Tuples, relations connect to each other.
Entity
Represents an object or concept that can be uniquely identified. Described by a set of attributes. Illustrated as a rectangle.
Entity Set
Represents a collection of entities of the same type.

Relationship
Represents an association between multiple entities.

Degree
How many entities are participating in the relationship. Most of the time relationships are binary, relationships with more degree are harder to work with thus can be simplified further. 4 types of degrees of relationships.
- Unary
- Binary
- Ternary
- N-ary
| Unary | Binary | Ternary |
|---|---|---|
| ![[unary.png]] | ![[binary.png]] | ![[ternary.png]] |
Cardinality
How many entities can be participated for the relationship from each side.
One-to-One (1:1)
Each entity in is related to at most one entity in , and vice versa.
One-to-Many (1:N)
Each entity in can be related to many entities in , but each entity in is related to only one entity in .
Many-to-One (N:1)
Each entity in relates to only one entity in , but an entity in can relate to many in .
Many-to-Many (M:N)
Entities in both sets can relate to many in the other.
Participation
Total Participation
Each entity in an entity set participates in at least one relationship instance. Illustrated as a double-line.
Partial Participation
Aka. optional participation. An entity may not participate in all relationship instances involving that entity set.
