Defining the primary key when creating a table

Use the Primary Key page of the Create Table notebook to define the primary key for your table. A primary key is a column or set of columns that can be used to identify or access a particular row or rows. A primary key is a unique key, that is it is a key that is constrained so that no two of its values are equal. A table cannot have more than one primary key, and the columns of a primary key cannot contain null values. To change a column to be nonnullable, use the Change Column window from the Columns page.

Fields and controls



To define the primary key:

  1. Click on the Primary Key tab.
  2. In the Available columns box, select the column or columns that you want to define as primary key columns. You can define up to 16 columns to be primary key columns.
  3. Click on the > push button to move the selected column or columns to the Primary key columns box.
  4. Optional: In the Constraint name field, type the constraint name of the primary key.
  5. If you do not want to add foreign keys or check constraints, click on OK to create your table and close the Create Table notebook. Otherwise, continue on to one or more of the optional tasks.


Related information