Database Reference
In-Depth Information
Customer
RecordNum
CustomerNum
CustomerName
...
Balance
CreditLimit
RepNum
1
148
Al's Appliance
...
$6,550.00
$7,500.00
20
and Sport
2
282
Brookings Direct
...
$431.50
$10,000.00
35
127
3
356
Ferguson's
...
$5,785.00
$7,500.00
65
4
408
The Everything
...
$5,285.25
$5,000.00
35
Shop
5
462
Bargains Galore
...
$3,412.00
$10,000.00
65
6
524
Kline's
...
$12,762.00
$15,000.00
20
7
608
Johnson's
...
$2,106.00
$10,000.00
65
Department Store
8
687
Lee's Sport and
...
$2,851.00
$5,000.00
35
Appliance
9
725
Deerield's
...
$248.00
$7,500.00
35
Four Seasons
10
842
All Season
...
$8,221.00
$7,500.00
20
FIGURE 4-10
Customer table with record numbers
s record on the basis of his or her record number, you might choose to
create and use an index, as shown in Figure 4-11.
To rapidly access a customer
'
CustomerNum Index
CustomerNum
RecordNum
148
1
282
2
356
3
408
4
462
5
524
6
608
7
687
8
725
9
842
10
FIGURE 4-11
Index for the Customer table on the CustomerNum field
The index has two fields. The first field contains a customer number, and the second field contains the
number of the record on which the customer number is found. Because customer numbers are unique, there
is only a single corresponding record number in this index. That is not always the case, however. Suppose,
for example, you wanted to quickly access all customers with a specific credit limit or all customers that are
represented by a specific sales rep. You might choose to create and use an index on credit limit as well as an
index on sales rep number. These two indexes are shown in Figure 4-12.
Search WWH ::




Custom Search