Databases Reference
In-Depth Information
check the Enforce Referential Integrity checkbox, as well as the Cascade Update
Related Fields checkbox. Do not check Cascade Delete Related Fields .
7. Next, drag the ISBN attribute name from the BOOKS table scheme to the ISBN
attribute name in the BOOK/AUTHOR table scheme. Again check the Enforce
Referential Integrity and Cascade Update Related Fields checkboxes.
8. Finally, drag the AuID attribute name from the AUTHORS table scheme to the
AuID attribute name in the BOOK/AUTHOR table scheme. Check the Enforce
Referential Integrity and Cascade Update Related Fields checkboxes. You should
now see the lines indicating these relationships, as shown in Figure 3-7. Note the
small 1s and
s, indicating the one side and many side of each relationship.
Figure 3-7. Relationships view showing various table relationships
9. To test the enforcement of referential integrity, try the following experiment: open
the BOOKS and PUBLISHERS tables, and arrange them so that you can see both
tables at the same time. Now change the value of PubID for Small House in the
PUBLISHERS table from 3 to 4. As soon as you move the cursor out of the Small
House row (which makes the change permanent), the corresponding PubID values
in BOOKS should change automatically! When you are done, restore the PubID
value in PUBLISHERS back to 3.
3.5 Index Files
When a table is stored on disk, it is often referred to as a file . In this case, each row of the
table is referred to as a record , and each column is referred to as a field . (These terms are
often used for any table.)
Since disk access is typically slow, an important goal is to reduce the amount of disk
accesses necessary to retrieve the desired data from a file. Sequential searching of the
data, record-by-record, to find the desired information may require a large number of disk
accesses and is very inefficient.
The purpose of an index file is to provide direct (also called random ) access to data in a
database file.
Figure 3-8 illustrates the concept of an index file. For illustration purposes, we have
changed the Publishers data, to include a city column. The file on the left is the index file
and indexes the Publishers datafile by the City field, which is therefore called theindexed
 
Search WWH ::




Custom Search