UNIQUE constraints
The UNIQUE constraint ensures that the values assigned to one or more columns in a table are always unique.
Unlike the NOT NULL, DEFAULT, and CHECK constraints, which can be associated with only a single column in a table, the UNIQUE constraint can be associated with either a single column or a set of columns in the table. The columns specified in a UNIQUE constraint must also have a NOT NULL constraint.
When a UNIQUE constraint is created, the Db2 database manager checks this to determine whether an index for the columns that the UNIQUE constraint refers to already exists. If so, that index will be marked as unique and system required. If not, an appropriate index is created with a SYSIBM schema and marked as unique and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access