Java Reference
In-Depth Information
The primary key for the Contact_Info Table is MemberID (shown in the tables as ID because of space
limitations). Columns in the Contact_Info Table that require indexes are the following:
 
ID — used extensively, any time you need data from the table.
 
City, State, Zip — used in regional searches.
After completing the registration form, the member will be given the option of entering vehicle
information for the auction part of the site. Vehicle data is stored primarily in the Product_Info and
Options tables.
Data Entry
The vehicle data will be divided amongst a number of tables, both for convenience in data entry and to
improve the efficiency of searches. The primary table will be the Product_Info table, which will contain
such data as the make, model and year of the vehicle. Secondary tables will be used for less important
data such as the optional accessories and photos of the vehicles.
The primary table: Product_Info
The Product_Info Table, shown in Table 11-3 , is used in most of the searches, so it is important to
ensure that it can be searched efficiently. This means that many of the columns will be indexed.
The primary key is Vehicle_ID. This key will also be used as the primary key of the Options table with
which the Product_Info table will have a one-to-one relationship. Note the use of the Member_ID
column as a foreign key linking the vehicle to its owner in the Contact_Info table.
Table 11-3: Product_Info Table
Vehicle_ID
Member_ID
Make
Body
Model
Year
Color
1000
1
Honda
Coupe
Civic
1996
Red
1001
1
Mitsubishi
SUV
Montero
2000
Green
1002
2
GM
Pickup
Sonoma
1999
Red
The Product_Info Table is updated using an HTML form, as shown in Figure 11-3 . The data-entry form
uses combo boxes extensively to minimize data-entry errors. It is particularly important to ensure that all
terms that may be used in searches are input using combo boxes. The reason for this is purely practical:
given the opportunity, a certain percentage of the users will enter data in the wrong place or in a format
that makes it useless in a search, so free text fields are used only where no search capability is
provided.
Figure 11-3: Data-entry form using combo-boxes to reduce data-entry errors
Search WWH ::




Custom Search