Description:
Binary relationship:
- Degree 2 meaning 2 entity instances are related in a relationship
- Many-to-many relationship
- One-to-many relationship
- One-to-one relationship
Ternary relationship:
- Degree 3 meaning 3 entity instances are related in a relationship
- Example: 2 parents to have 1 children
Cardinality:
- Specifies the requirement of how many entity instance can be from or to in a relationship
- Min-max cardinalities:
- Example: a department can exist with minimum one employee
- Typically min is 0 or 1
- In Mermaid entity relationship diagram, use relationship syntax
- Min-max cardinalities:
Recursive relationship
-
It is possible for an entity to have a relationship to itself—this is called a recursive relationship (also known as a unary relationship)
-
erDiagram CUSTOMER ||--o{ CUSTOMER: "refers to" CUSTOMER { string name string custNumber string sector }