Notes and Study Materials

User Rating: 3 / 5

Star ActiveStar ActiveStar ActiveStar InactiveStar Inactive
 

The minimum cardinality of a relationship is the minimum number of instances of entity B that may be associated with each instance of entity A. In our videotape example, the minimum number of videotapes for a movie is zero. "When the minimum number of participants is zero, we say that entity type B is an optional participant in the relationship. In this example, VIDEOTAPE (a weak entity type) is an optional participant in the "Is_stacked_as" relationship. This fact is indicated by the symbol zero through the line near the VIDEOTAPE entity in the following Figure.

cardinality constraint_minimum cardinality

Maximum Cardinality:

The maximum cardinality of a relationship is the maximum number of instances of entity B that may be associated with each instance of entity A. In the video example, the maximum cardinality for the VIDEOTAPE entity type is "many"-that is, an unspecified number greater than one. This is indicated by the "crow's foot" symbol on the line next to the VIDEOTAPE entity symbol in the above Figure.

cardinality constraint_maximum cardinality

Some Examples

1. PATIENT  Has_recorded  PATIENT HISTORY

Each patient has one or more patient histories. (The initial patient visit is always recorded as an instance of PATIENT HISTORY) Each instance of PATIENT HISTORY "belongs to'" exactly one PATIENT.

2. EMPLO'I'EE Is_assigned_to PROJECT.

Each PROJECT has at least one EMPLO'I'EE assigned to it. (Some projects have more than one.) Each EMPLO'I'EE mayor (optionally) may not be assigned to any existing PROJECT (e.g .• employee "Pete"). or may be assigned to one or more PROJECTs.

3. PERSON Is_married_to PERSON.

This is an optional zero or one cardinality in both directions, because a person mayor may not be married.

cardinality constraint_optional zero