Databases Reference
In-Depth Information
simply and directly describe the entity, with no complications involving other
entities. Putting quantity in either the salesperson or the product entity box
just will not work.
Understanding Intersection Data
The quantity attribute doesn't describe either the salesperson alone or the product
alone. It describes the combination of a particular occurrence of one entity type
and a particular occurrence of the other entity type. The quantity 170 doesn't
make sense as a description or characteristic of salesperson number 137 alone.
She sold many different kinds of products. To which one does the quantity
170 refer? Similarly, the quantity 170 doesn't make sense as a description or
characteristic of product number 24013 alone. It was sold by many different
salespersons.
In fact, the quantity 170 falls at the intersection of salesperson number 170
and product number 24013. It describes the combination of or the association
between that particular salesperson and that particular product, and it is known
as intersection data. This is similar to the mapping table described earlier, but
containing data in addition to the associations. Figure 3-15 shows the many-to-
many relationship between salespersons and products with the intersection data,
quantity, as represented in a special five-sided intersection data box. Notice that
the intersection data box is attached to the relationship diamond between the
two entity boxes. That is the natural place for it to be drawn. Pictorially, it looks
like it is at the intersection between the two entities, but there is more to it than
that. The intersection data describes the relationship between the two entities.
We know that an occurrence of the Sells relationship specifies that salesperson
137 has sold some of product 24013. The quantity 170 is an attribute of that
Figure 3-15
SALESPERSON
PRODUCT
Salesperson
Number
Salesperson
Name
Commission
Percentage
Year of Hire
*
Product
Number
Product
Name
Unit Price
*
Sells
Quantity
Intersection data.
Search WWH ::




Custom Search