Scalable Database Server, HiRDB Version 8 Description

[Contents][Glossary][Index][Back][Next]

3.3.4 Primary key

A primary key makes it possible to uniquely identify the rows in a table. The columns constituting a defined primary key are subject to the uniqueness constraint and the NOT NULL constraint. The uniqueness constraint means that no value can be duplicated in the key area (column or set of columns)[Figure]i.e., there is a constraint that all data entries in the key columns must be unique. The NOT NULL constraint means that the null value is not permitted as a value in the key columns.

If there are one or more columns or sets of columns (called candidate keys) on the basis of which the rows in a table can be uniquely identified, you can select a primary key from among the candidate keys. You should define this primary key so that it is mnemonically significant and appropriate for being assigned the uniqueness and NOT NULL constraints.

The primary key is defined with the PRIMARY KEY option in the CREATE TABLE. For details about the primary key, see the HiRDB Version 8 Installation and Design Guide.