Database Reference
In-Depth Information
Customer
CustomerNum
CustomerName
RepNum
61
148
Al's Appliance and Sport
20
282
Brookings Direct
35
356
Ferguson's
65
408
The Everything Shop
35
462
Bargains Galore
65
524
Kline's
20
608
Johnson's Department Store
65
687
Lee's Sport and Appliance
35
725
Deerield's Four Seasons
35
842
All Season
20
701
Peters
05
Rep
RepNum
LastName
FirstName
20
Kaiser
Valerie
35
Hull
Richard
65
Perez
Juan
75
Lewis
Joan
FIGURE 2-40
Customer and Rep tables
TheresultofjoiningtheCustomerandReptablescreatesthetableshowninFigure2-41.Thecolumnthat
joins the tables (RepNum) appears only once. Other than that, all columns from both tables appear in the result.
Te m p
CustomerNum CustomerName
RepNum LastName FirstName
148
Al's Appliance and Sport
20
Kaiser
Valerie
282
Brookings Direct
35
Hull
Richard
356
Ferguson's
65
Perez
Juan
408
The Everything Shop
35
Hull
Richard
462
Bargains Galore
65
Perez
Juan
524
Kline's
20
Kaiser
Valerie
608
Johnson's Department Store
65
Perez
Juan
687
Lee's Sport and Appliance
35
Hull
Richard
725
Deerield's Four Seasons
35
Hull
Richard
842
All Season
20
Kaiser
Valerie
FIGURE 2-41
Table produced by joining the Customer and Rep tables
When a row in one table does not match any row in the other table, that row will not appear in the result of
the join. Thus, the row for sales rep 75 (Joan Lewis) from the Rep table and the row for customer 701 (Peters)
from the Customer table do not appear in the join table because their rows are not common to both tables.
You can restrict the output from the join to include only certain columns by using the PROJECT com-
mand, as shown in the following example.
Search WWH ::




Custom Search