Databases Reference
In-Depth Information
Cardinality
One-to-One Binary Relationship Figure 2.3 shows three binary relationships of
different cardinalities , representing the maximum number of entities that can be
involved in a particular relationship. Figure 2.3a shows a one-to-one (1-1) binary
relationship, which means that a single occurrence of one entity type can be
associated with a single occurrence of the other entity type and vice versa. A
particular salesperson is assigned to one office. Conversely, a particular office (in
this case they are all private offices!) has just one salesperson assigned to it. Note the
''bar'' or ''one'' symbol on either end of the relationship in the diagram indicating
the maximum one cardinality. The way to read these diagrams is to start at one
entity, read the relationship on the connecting line, pick up the cardinality on the
other side of the line near the second entity , and then finally reach the other entity.
Thus, Figure 2.3a, reading from left to right, says, ''A salesperson works in one
(really at most one, since it is a maximum) office.'' The bar or one symbol involved
SALESPERSON
PK
OFFICE
Salesperson
Number
Salesperson
Name
Commission
Percentage
Year of Hire
PK
Office
Number
Telephone
Size
Works in
Occupied by
One
Salesperson
One
Office
(a.) One-to-one (1-1) binary relationship
SALESPERSON
PK
CUSTOMER
PK
Salesperson
Number
Salesperson
Name
Commission
Percentage
Year of Hire
Customer
Number
Costomer
Name
HQ City
Sells to
Buys from
One
Salesperson
Many
Customers
(b.) One-to-many (1-M) binary relationship
SALESPERSON
PK
PRODUCT
Salesperson
Number
Salesperson
Name
Commission
Percentage
Year of Hire
PK
Product
Number
Product
Name
Unit Price
Sells
Sold by
Many
Products
Many
Salespersons
(c.) Many-to-many (M-M) binary relationship
FIGURE2.3
Binary relationships with cardinalities
Search WWH ::




Custom Search