In a microsoft access database, something like the gettysburg address would be stored in a(n) ________ field.

A primary key is a field or set of fields with values that are unique throughout a table. Values of the key can be used to refer to entire records, because each record has a different value for the key. Each table can only have one primary key. Access can automatically create a primary key field for you when you create a table, or you can specify the fields that you want to use as the primary key. This article explains how and why to use primary keys.

To set a table’s primary key, open the table in Design view. Select the field (or fields) that you want to use, and then on the ribbon, click Primary Key.

Note:  This article is intended for use only with Access desktop databases. Access automatically manages primary keys for new tables in Access web apps and web databases. Although it is possible to override these automated primary keys, we don’t recommend that you do.

Access uses primary key fields to quickly associate data from multiple tables and combine that data in a meaningful way. You can include the primary key fields in other tables to refer back to the table that is the source of the primary key. In those other tables, the fields are called foreign keys. For example, a Customer ID field in the Customers table might also appear in the Orders table. In the Customers table, it is the primary key. In the Orders table it is called a foreign key. A foreign key, simply stated, is another table's primary key. For more information, see Database design basics.

In a microsoft access database, something like the gettysburg address would be stored in a(n) ________ field.

1. Primary key

2. Foreign key

If you are moving existing data into a database, you may already have a field that you can use as the primary key. Often, a unique identification number, such as an ID number or a serial number or code, serves as a primary key in a table. For example, you might have a Customers table where each customer has a unique customer ID number. The customer ID field is the primary key.

Access 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 you create a new table in Datasheet view, Access automatically creates a primary key for you and assigns it a field name of "ID" and the AutoNumber data type.

A good candidate for a primary key has several characteristics:

  • It uniquely identifies each row

  • It is never empty or null — it always contains a value

  • The values it contains rarely (ideally, never) change

If you can’t identify a good key, create an AutoNumber field to use as the key. An AutoNumber field automatically generates a value for itself when each record is first saved. Therefore, an AutoNumber field meets all three characteristics of a good primary key. For more information on adding an AutoNumber field, see the article Add an AutoNumber field as a primary key.

In a microsoft access database, something like the gettysburg address would be stored in a(n) ________ field.

An AutoNumber field makes a good primary key.

Any field that is missing one or more of the characteristics of a good candidate key is a poor choice for a primary key. Here are a few examples of fields that would make poor primary keys for a Contacts table, along with reasons why they would be poor choices.

Poor primary key

Reason

Personal name

Might not be reliably unique, and may change

Phone number

Likely to change.

E-mail address

Likely to change.

Zip code

More than one person may share a ZIP code

Combinations of facts and numbers

The fact portion might change, creating a maintenance burden. Could lead to confusion if the fact portion is repeated as a separate field. For example, combining the city and an incremented number (e.g., NEWYORK0579) would be a poor choice if the city is also stored as a field.

Social Security Numbers

  • Private information and not allowed in government departments and some organizations.

  • Some people don’t have a SSN

  • An individual may have more than one in a lifetime

In some cases, you want to use two or more fields in a table as the primary key. For example, an Order Details table that stores line items for orders might use two fields in its primary key: Order ID and Product ID. A key that has more than one field is called a composite key.

For a primary key to work well, the field must uniquely identify each row, never contain an empty or null value, and rarely (ideally, never) change. To set the primary key:

  1. Open the database that you want to modify.

  2. In the Navigation Pane, right click the table in which you want to set the primary key and, on the shortcut menu, click Design View.

    Tip: If you don't see the Navigation Pane, press F11 to display it.

  3. Select the field or fields that you want to use as the primary key.

    To select one field, click the row selector for the field you want.

    To select more than one field to create a composite key, hold down CTRL and then click the row selector for each field.

  4. On the Design tab, in the Tools group, click Primary Key.

    In a microsoft access database, something like the gettysburg address would be stored in a(n) ________ field.

    A key indicator is added to the left of the field or fields that you specify as the primary key.

If you decide to change a table's primary key, you can do so by following these steps:

For more information about database design and choosing an appropriate primary key, see the articles:

Top of Page

_____D_____7.In a Microsoft Access database, something like the Gettysburg Address would

be stored in a(n) ________ field.

Get answer to your question and much more

_____B_____8.You can set a ________, which is automatically displayed in a field unless theuser enters something different.Which of the following is a likely primary key?________ is used to ensure that data is organized most efficiently.a.Range checkingb.Consistency checkingc.Normalizationd.Validation_____B_____11.________ databases are the most commonly used electronic databases.A ________ relationship indicates that for each record in a table, there is onlya single corresponding record in a related table.13.________ means that for each value in the foreign key of one table, there is acorresponding value in the primary key of another table.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 5 pages?

Upload your study docs or become a

Course Hero member to access this document