Primary Key

Each record in a table has a unique primary key. At the database design stage, you select the fields that identify the records. You may need to introduce new fields to ensure record uniqueness. For example, in a customer table, the customer name is not guaranteed unique, but a numeric field CUSTOMER_NUMBER can be introduced to act as the primary key.

You can define a multi-part key, composed of up to 99 fields. The ORDER_LINE table below has a two part key:

The precedence of the key fields is shown by the number on the left. In the ORDER_LINE table, ORDER_NUMBER is the first part of the key and takes precedence over the LINE key field.

The MATERIAL_CODE field is marked with an asterisk. This indicates that this field is a secondary key. Secondary keys define a link to another table.