On the other hand, if we keep courses in the database
that are no longer actively taught for some reason, then the minimum cardinality on the student side of the
takes/is-taken-by relationship will be 0.
Figure 8-1 shows a data model for the entities and relationships we have been discussing, using one of
many standard approaches for graphically representing the entity-relationship diagram. Figure 8-1 was created
using Microsoft Visio.
The rectangles represent entities, and the label in the upper portion of an entity rectangle specifies the identifier,
or key, for the entity type. For dormitories, for example, the dorm name is the identifier; the name of the dorm
distinguishes the record of one dorm from that of another. The labels in the lower portion of the entity rectangles
represent the other attributes of the entity. The dorm entity includes information for each dorm about the total
number of rooms in the dorm, the number of vacant rooms in the dorm, and the room rental rate for the dorm.
CHAP. 8] DATABASE 141
The lines represent relationships between entities, and the marks at the ends of the lines represent the cardinalities.
A circle at the end of a line means that the relationship is optional with respect to that entity; a bar at the
end of a line means that only one instance of that entity type may participate in an instance of the relationship; and
a ???crows foot??? means that many instances of that entity type may participate in an instance of the relationship.
Pages:
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395