Please enable JavaScript to view this site.

R:BASE 11 Help

A primary key is a column, or set of columns, that uniquely identify a row, meaning that each value in a primary key column is unique. As a constraint, the primary key prevents duplicate (non-unique) and null values from being entered into the column.

 

A primary key could be something like an employee id column in an employee table or it could be a combination of the customer's id and the customer's phone number.

 

Notes:

 

Only one Primary Key can be defined per table.

Defining a Primary Key automatically enforces "not NULL" and "unique" constraints on the column(s).

A Primary Key cannot be defined if any one of the columns included in the desired key already have a NULL or duplicate values.

R:BASE automatically builds an index on the specified column(s) when a Primary Key is defined.

Every table should have a column or set of columns that identify a row, and (in a well-designed database) should have a Primary Key.

A Primary Key definition is used instead of a Rule to prevent duplicates, and has the advantage of faster performance. It is recommended to delete the rules and indexes that are no longer needed before defining a Primary Key constraint.