Databases Reference
In-Depth Information
Sales Manager
Salesperson 137
Reports to
FIGURE 6.2
Salespersons 142, 323, and 411
reporting to salesperson 137 who is their
sales manager
Salesperson 142
Salesperson 323
Salesperson 411
186
285
137
439
267
483
412
323
411
170
198
204
361
388
446
FIGURE 6.3
General Hardware Company salesperson
reporting hierarchy
is associated with many salespersons below, except for the bottom-level salespersons
who are not sales managers and thus have no one reporting to them.
Figure 6.4, which is an expansion of the General Hardware Co. SALESPER-
SON relation in Figure 6.1a, demonstrates how this type of relationship is reflected
in a relational database. A one-to-many unary relationship requires the addition of
one column to the relation that represents the single entity involved in the unary
relationship. In Figure 6.4, the Sales Manager Number attribute is the new attribute
that has been added to the SALESPERSON relation. The domain of values of the
new column is the same as the domain of values of the relation's primary key. Thus,
the values in the new Sales Manager Number column will be three-digit whole
numbers representing the unique identifiers for salespersons, just like the values
in the Salesperson Number column. The value in the new column for a particular
row represents the value of the next entity ''upward'' in the unary one-to-many
hierarchy. For example, in the row for salesperson number 323, the sales manager
Search WWH ::




Custom Search