The Entity-Relationship (ER) model places an important constraint on the entities of a particular entity type (records in a table). This is the key or uniqueness constraint on the properties (fields). An entity type usually has at least one property which contains unique values for each entity. This property is used to uniquely identify each record. The following table shows how the ER model concepts are related to C/SIDE concepts.

ER model concept Corresponding C/SIDE concept

Constraints on the entities of an entity type

Constraints on the records in a table

The uniqueness constraint on entity properties

A key based on fields in a table

The records in a table must be arranged according to some criteria (that is, a key) so that C/SIDE can work efficiently with the data in tables. For example, an Employee table can be ordered according to the employees' social security numbers because this number uniquely identifies each employee.

For a field to be a key for a table, there must be a uniqueness constraint for every record in the table. This constraint prevents any two records from having the same value in the key field. It is not a constraint on a specific record, but a constraint on all the records in the table.

Sometimes, a key consists of several fields. In this case, the combination of the values in all the fields in the key must be unique for each record. Sometimes you can define several keys for a table. For more information about defining keys, see How to: Define Primary and Secondary Keys.