Professional Documents
Culture Documents
Bamweyana Ivan
LSG 2102
Relationships
• Association / Connections between entities
• Participants are entities that participate in a relationship
• Relationships between entities always operate in both
directions, i.e. bidirectional
• Relationship features:
Cardinality, also called multiplicity (number of occurrences of the
entities participating in a relationship)
Degree of relationship (how many entities are involved in a
relationship)
Relationship : Cardinality (Multiplicity)
• Cardinality expresses the minimum and maximum
number of entity occurrences associated with one
occurrence of the related entity;
• Minimum cardinality: minimum number of entity instances
that must participate in a relationship
• Maximum cardinality:……..
• Four types:
• One-to-one (1:1)
• One-to-Many (1:M or 1:N)
• Many-to-one (M:1)
• Many-to-Many (N:M or M:N)
One to one (1:1)
• A staff member can be the manager for at most one
cinema and a cinema can have at most one manager
1 1
Staff Manages
Cinema
One to Many (1:N or 1:M)
• Each cinema can have many screens
1 M
M 1
Located
Subway in Suburb
Many to Many (M:M or N:N)
• Each author may have many books and each book may
have several authors
M N
Author Writes
Book
Many to Many (M:N or N:M)
• An actor may be cast in many films and a film may have
more than one actor
M N
A Relationship
B
Relationships: Participation
• Optional (partial) participation
• One entity occurrence does not require corresponding entity
occurrence in particular relationship
• Participation represents in a single line
• Mandatory (total) participation
• One entity occurrence requires corresponding entity occurrence in
particular relationship
• Participation represented in a double line
• Entity Relationship Diagram
Relationships: Degree
• Degree of relationship indicates the number of entities or
participants associated with a relationship
• Three types:
Unary (association is maintained within single entity) – see
recursive relationship
Binary (two entities are associated)
Ternary (three entities are associated)
Recursive Relationship
• The entity has a relationship with itself.
• The same entity participates more than once in a relationship
• E.g. an employee reports to an employee
1
Employee Reports
1
Example: Ternary
Multiple Relationships; same entities
• A pair of entities can have more than one relationship
linking them
• There may be different cardinalities and different
participation for each relationships
Alternate Relationship Denotations
• You will see variations on the ERD style used