A particular type of weak entity is the ???ID-dependent entity.??? An ID-dependent entity is a weak entity, such
that the ID of the associated strong entity is also part of the identifier of the ID-dependent entity. Imagine the
strong entity ???Building??? and the ID-dependent entity ???Room???. Attributes of a room may include size, seating
capacity, number of windows, etc., but a room only makes sense in the context of a building, and the identity
of a room will include the building name as well as the room number.
Another application of ID-dependent entities occurs when attributes are ???multivalued.??? For instance,
a professor may have more than one degree, or more than one telephone number. We model such multivalued
142 DATABASE [CHAP. 8
Figure 8-1 Example entity-relationship (E-R) diagram.
attributes as ID-dependent entity types, and we specify 1:N relationships between the strong entity and the
ID-dependent entities.
Relationships may also be recursive. That is, a relationship can exist among instances of the same entity type.
For example, we might want to model the relationship between students who room together. In that case, we would
define a recursive N:M student:roommate relationship to model the fact that students may room with one or more
others.
Pages:
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397