Background documentationUNIQUE Definition (unique_definition) Locate this document in the navigation structure

 

A UNIQUE definition (unique_definition) in the CREATE TABLE statement defines the uniqueness of column value combinations.

Structure

Syntax Syntax

  1. <unique_definition> ::=
      [CONSTRAINT <index_name>] UNIQUE (<column_name>,...)
End of the code.
Examples

SQL Tutorial, Indexes

Explanation

Specifying a UNIQUE definition in a CREATE TABLE statement has the same effect as specifying the CREATE TABLE statement without a UNIQUE definition, but with a CREATE INDEX statement with UNIQUE.

  • Index name specified: The index generated is stored under this name in the database catalog.

  • No index name: The database system assigns a unique index name to the index.