Relationships

Relationships between two entity types are defined by specifying the two entity types involved, that is, the source entity type (the existentially independent) and the target entity type (the existentially dependent entity type). The relationship is oriented; from the independent entity type to the dependent entity type. Relationships have these characteristics:

  • category
  • cardinality
  • their business significance

The relationship Offers exists between the entity types Faculty (source entity type) and Courses (target entity type).

Category

A relationship category can be hierarchical, aggregating, referential or external.

Hierarchical:

There is a hierarchical relationship category between two entity types when the following apply:

  • The target entity type is existentially dependent upon the source entity type, that is, the life span of a characteristic of the target entity type is shorter than or equal to the life span of the characteristic of the source entity type.
  • The target entity type is generated from the source entity type, that is, the source entity type influences the characteristic values directly.
  • The target entity type represents a semantic refinement, that is, the target entity type is a classification of the source entity type which describes the source entity type more precisely.

The key of the source entity type becomes part of the key of the target entity type. The relationship between two entities may not be changed.

The relationship Offers with the cardinality 1:CN exists between the entity types Faculty (source entity type) and Courses (target entity type).

The source entity type Faculty has the attributes Faculty number (key attribute) and Faculty name.

The target entity type Courses has the attributes Faculty number (key attribute), Course number (key attribute), Number of the course instructor and Course title.

Since, with this category of relationship, the source entity identifies the associated target entity by means of a part of the key attributes, a change to a relationship would mean that the target entity would be deleted and a new target entity would be created.

Aggregating:

There is an aggregating relationship category between two entity types when the following apply:

  • The target entity type is existentially dependent on the source entity type, that is, the life span of a characteristic of the target entity type is shorter than or equal to the life span of the characteristic of the source entity type.
  • The target entity type is generated from the source entity type, that is, the source entity type influences the characteristic values directly.
  • At least one other source entity type, different from the first one, is involved in the formation of the target entity type.

The keys of the source entity types become part of the canonic key of the target entity type.

The aggregating and the hierarchical relationship categories differ from one another only in the third characteristic.

Referential:

There is a referential relationship category when the following apply:

  • The target entity type is existentially dependent on the source entity type.
  • The source entity type determines the context of the target entity type, that is, an attribute group of the start entity type is present in the target entity type, but this does not generate the target entity type.

The key attributes of the source entity type are included in the target entity type as non-key-attributes. A relationship between two entities can be changed.

The relationship Teaches with cardinality 1:CN exists between the entity types Professor (source entity type) and Courses (target entity type).

The source entity type Professor has the attributes Number (key attribute), Name, Address, and Remuneration class.

The target entity type Courses has the attributes Faculty number (key attribute), Course number (key attribute), Number of the course instructor and Course name.

A distinction is made between strong and weak existential dependence. Strong existential dependence requires there to be an assignment to exactly one characteristic of the source entity type for each characteristic of the target entity type. If this condition applies only to one (time-dependent) subset of the target entity type, the existential dependence is said to be weak.

Weak existential dependence can occur in aggregating and referential relationship categories but not in hierarchical relationship categories.

This results in the following situation:

Classification of relationship categories

 

strong

existential dependence

weak

existential dependence

Generates

hierarchical

aggregating

conditional-aggregating

Context

referential

conditional-referential

temporary-referential

External:

A relationship is in the ‘external’ category if it is between an entity type within a data model and an entity type outside the data model.

Cardinality

The cardinality (n : m) describes the relationship with respect to the number of dependent entities (entities of the target entity type of the relationship) and referenced entities (entities of the source entity type) allowed for the relationship.

The possible values for the left and right sides of the cardinality have the following significance:

n = 1

Each dependent entity has one referenced entity.

n = C

Dependent entities can exist that do not refer to an entity of the source entity type.

m = 1

Each entity of the source entity type has one dependent entity.

m = C

Each entity of the source entity type has a maximum of one dependent entity.

m = N

Each entity of the source entity type has at least one dependent entity.

m = CN

Each entity of the source entity type can have any number of dependent entities.

The Structured Entity Relationship Model (SERM) does not allow m:n relationships (i.e. many-to-many relationships). Therefore, entity types in SERM can be arranged from left to right, from independent to dependent entity type.

The cardinality C:x (x = 1, C, CN, N) should be used above all for relationships of the category 'referential'. However, it can also be used for relationships of the category 'aggregating'.

Hierarchical relationships do not allow this cardinality, since all dependent entities must refer to an entity of the source entity type.

Other subjects:

Data Modeler: overview

Entity types

Attributes of entity types

Specializations/generalizations

Structural concept: data model and data model hierarchy

Top-down and bottom-up modeling

Consistency checks