Requirements for Weak Entity Sets

Requirements for Weak Entity Sets

We cannot get key attributes for a weak entity set indiscriminately. Rather, if E is a weak entity set then its key comprises:

1. Zero or more of its own attributes, and

2. Key attributes from entity sets that are reached by certain many-one relationships from E to other entity sets. These many-one relationships are called supporting relationships for E.

In order for R, a many-one relationship from E to some entity set F, to be a supporting relationship for E, the following conditions must be followed:

a) R must be a binary, many-one relationship from E to F.  (Remember that a one-one relationship is a special case of a many-one relationship. When we say a relationship must be many-one, we always include one-one relationships as well.)

b) R must have referential integrity from E to F. That is, for every E-entity, the F-entity related to it by R must actually exist in the database. Put another way, a rounded arrow from R to F must be justified.

c) The attributes that F supplies for the key of E must be key attributes of F.

d) However, if F is itself weak, then some or all of the key attributes of F supplied to E will be key attributes of one or more entity sets G to which F is connected by a supporting relationship. Recursively, if G is weak, some key attributes of G will be supplied from elsewhere, and so on.

e) If there are various different supporting relationships from E to F, then each relationship is used to supply a copy of the key attributes of F to help form the key of E. Note that an entity e from E may be related to different entities in F through different supporting relationships from E. Therefore, the keys of various different entities from F may appear in the key values identifying a specific entity e from E.

The intuitive reason why these conditions are required is as follows. Consider an entity in a weak entity set, say a crew in example (a) of "Weak Entity Sets". Each crew is unique, abstractly. In principle we can tell one crew from another, even if they have the same number but belong to different studios. It is only the data about crews that makes it hard to differentiate crews, because the number alone is not enough. The only way we can connect additional information with a crew is if there is some deterministic process leading to additional values that make the designation of a crew unique. But the only unique values connected with an abstract crew entity are:

1. Values of attributes of the Crews entity set, and

2. Values acquired by following a relationship from a crew entity to a unique entity of some other entity set, where that other entity has a unique associated value of some kind. That is, the relationship followed must be many-one (or one-one as a special case) to the other entity set F, and the associated value must be part of a key for F.