Databases Reference
In-Depth Information
FIGURE 7.4
The Suppliers Table in Design View.
contained within the database are shown in the Design View. Similarly, Figure 7.4 shows the
Suppliers Table laid out in Design View.
The final concept to be covered is that of the key. Simply stated, a key is a value (or group of
values) that can be utilized to identify a particular record or group of records within a database. A
primary key is a value that can be used to identify a single record in a table. Primary keys should
be immutable, meaning that its value cannot be changed during the course of normal operations
of the database. A primary key can be a normal attribute that is guaranteed to be unique (such as
Social Security Number in a table with no more than one record per person), or it can be generated
by the Database Manager as a globally unique identifier. A plurality of keys can be utilized in
combination to create a primary key. A key consisting of attributes of many keys is referred to as
a compound key. For the sake of simplicity, a compound key is
usually
not appropriate to utilize
as a primary key.
In terms of the sample application, some thought has to be given as to how to set up the keys
for each table. The Suppliers Table will only utilize one field as its primary key. The NAME column
will be utilized as the primary key for the Suppliers Table. Although a supplier may carry more
than one manufacturer, or two suppliers may be in the same city, each supplier will have a unique
name. Setting a single primary key is easy; the user must view the table in Design View, choose a
single field (shown as a row), and either right-click and select “Primary Key” from the menu or
press the primary key button on the Access toolbar (Figure 7.5).
FIGURE 7.5
Selecting a single primary key for the Suppliers Table.
Search WWH ::




Custom Search