Database Reference
In-Depth Information
to one object indicate the number of the instances of that object associated with
one instance of the other object.
Looking at the above cardinality indicators, what can you say about the real-
world information portrayed by the data model? How many employees does one
supervisor can have under his or her supervision? For the answer, look at the car-
dinality indicators next to the other object, EMPLOYEE. What do you see? A
minimum cardinality of 1 and a maximum cardinality of *. This means a supervisor
must supervise at least one employee but may supervise many employees. Now ask
the other question. How many supervisors does one employee report to? To answer
this question, look at the cardinality indicators “1,1” next to the other object,
SUPERVISOR. These indicators represent the real-world condition that each
employee must report to one supervisor and an employee cannot report to more
than one supervisor.
Continue with the other relationship in the figure between EMPLOYEE and
PROJECT. A project must have at least one employee; furthermore, a project may
have many employees. From the other point of view, an employee may be assigned
to only one project and not more. Also, some employees may be associated with no
project (note minimum cardinality of “0”) at all.
Let us summarize maximum and minimum cardinalities with one more example
involving three objects. In particular, note carefully how the minimum cardinality
indicator expresses the optional or mandatory participation of object instances in a
relationship. Figure 6-12 displays three objects, CUSTOMER, ORDER, and
PRODUCT, and indicates their relationships.
CUSTOMER and ORDER are in a one-to-many relationship; ORDER and
PRODUCT are in a many-to-many relationship. Note the minimum cardinality of
“1” or “0.” Read the explanation given in the figure and understand how “1” as the
minimum cardinality indicates the mandatory nature of the relationship and how
“0” as the minimum cardinality denotes its optional nature.
Aggregate Objects
Let us suppose you are modeling the information requirements for a dental office.
Two objects in your data model will be PATIENT and SERVICE. Now consider
CUSTOMER
places
ORDER
0, *
1,1
0, *
Connection Types:
Mandatory
contains
(1,1) or (1, * )
1. *
(0,1) or (0, * )
Optional
PRODUCT
Figure 6-12
Optional and mandatory participation in relationship.
Search WWH ::




Custom Search