Primary keys
The primary key contains unique values and identifies each row in a table. The primary key cannot contain NULL values. A table can have only one primary key and this primary key can consist of single or multiple columns. When a primary key consists of multiple columns, the data from these columns is used to determine whether a row is unique.
Create a primary key
-
In the Database tool window ( ), expand the data source tree until the node of a child table.
-
Right-click a child table and select
. -
On the Columns tab, click the Add button (
) and type the column name.
-
Select the column settings:
-
Not null: add the NOT NULL constraint that enforces a column to not accept NULL values.
-
Auto inc: automatically generate a unique number when a new record is inserted into a table.
-
Unique: ensure that all values in a column are different.
-
Primary key: identify a column as a primary key.
-
-
Click Execute.