Databases Reference
In-Depth Information
Figure 4-11
SALESPERSON
Sale
PRODUCT
Salesperson
Number
Salesperson
Name
Commission
Percentage
Year of Hire
Quantity
*
Product
Number
Product
Name
Unit Price
*
SALESPERSON, SALE, and PRODUCT entities.
Most relational DBMS systems do not directly support many-to-many rela-
tionships. Instead, you must also include an associative entity, in this case SALE,
to establish the relationship. The E-R diagram in Figure 4-11 includes the asso-
ciative entity.
Each of the two entities converts to a table with its own attributes but with
no foreign keys (regarding this relationship). The SALESPERSON table and the
PRODUCT table in Figure 4-12 each contain only the attributes shown in the
SALESPERSON and PRODUCT entity boxes in Figure 4-10 and Figure 4-11.
The primary key of this associated SALE table is the combination of the unique
identifiers of the two entities in the many-to-many relationship. The primary
Figure 4-12
SALESPERSON
Salesperson
Number
Salesperson
Name
Commission
Percentage
Year of
Hire
PRODUCT
Product
Number
Product
Name
Unit Price
SALE
Salesperson
Number
Product
Number
Quantity
Many-to-many relational tables.
Search WWH ::




Custom Search