Download development of an electronic arabic dictionary siti noormaya binti

Transcript
43
A foreign key, simply stated, is another table's primary key.
A good
candidate for a primary key has several characteristics. First, it uniquely identifies
each row. Second, it is never empty or null. It always contains a value. Third, it
rarely or ideally and never changes. Access uses primary key fields to quickly bring
together data from multiple tables. An example of a poor choice for a primary key
would be a name or address. Both contain information that might change over time.
Always specify a primary key for a table. Access will automatically creates an index
for the primary key, which helps speed up queries and other operations. Access also
ensures that every record has a value in the primary key field, and that it is always
unique.
When create a new table in Datasheet view, Access automatically creates a
primary key and assigns it a field name of "ID" and the AutoNumber data type. The
field is hidden by default in Datasheet View, but you can see the field if you switch
to Design View. The primary key toolbar can be seen on the Design tab, in the
Tools group, click Primary Key such shown in Figure 4.18. A key indicator is
added to the left of the field or fields that you specify as the primary key.
Figure 4.18:
Primary Key Toolbar
Although the primary key have been set, it can also be edited in time, if there
still need to modify the design structure. This primary key and the relationship are
really important to make sure the structure of the database is according to the
specification.