Data Manipulation  «Prev  Next»

Primary Key - Exercise

Objective

Create a primary key field in the Clients and Projects tables.

Scoring

You will receive 2 points for this exercise. This exercise is auto-scored, which means all you need to do to receive full credit is complete the steps and click Submit.

Overview

Neither the Projects table nor the Clients table currently has a primary key. Because tables typically require primary keys to participate reliably in relationships, you will define a primary key for each table using two different approaches: (1) selecting an existing field as a key and (2) creating an AutoNumber key.

Instructions

  1. Open the Clients table in Design View.
  2. Define the Company field as the primary key.
    • Click the row selector for Company and click the Primary Key button (key icon).
    • If Access warns you about duplicates or blanks, correct the data before continuing.
  3. Save the table design and close the Clients table.
  4. Open the Projects table in Design View.
  5. Create a new field named Project ID and set its data type to AutoNumber.
    • Best practice: place the primary key field first. If needed, move Project ID to the top of the field list.
  6. Set Project ID as the primary key.
  7. Save the table design and close the Projects table.
  8. When finished, click Submit to continue to the Exercise Result page.

Blue Host 300by250Blue Host 300by250