Unique constraints

 

Unique constraints act as controls in a database to ensure that rows are unique.

For example, you can specify a customer identification number as a unique constraint in your database. If anyone attempts to create a new customer with the same customer number, an error message is sent to the database administrator.

Unique constraints identify a field or set of fields in a database file whose values must be unique across records in the file. The field must be in ascending order, and can be null-capable.

A file can have multiple unique constraints, but you cannot duplicate unique constraints. The same key fields, regardless of order, constitute a duplicate constraint.

A unique constraint can be used as the parent key when adding a referential constraint.

 

Parent topic:

Controlling the integrity of your database with constraints