Defining Unique Keys
The definition of unique keys is syntactically very similar to primary keys.
ALTER TABLE
ADD UNIQUE ( {, }... )
Likewise, unique keys can be defined as part of the CREATE TABLE SQL statement.
CREATE TABLE TABLE_NAME ( id_col INT, col2 CHARACTER VARYING(20), key_col SMALLINT, ... CONSTRAINT key_unique UNIQUE(key_col), ... ) CREATE TABLE TABLE_NAME ( id_col INT PRIMARY KEY, col2 CHARACTER VARYING(20), ... key_col SMALLINT UNIQUE, ... )Read more about this topic: Unique Key
Famous quotes containing the words defining, unique and/or keys:
“The industrial world would be a more peaceful place if workers were called in as collaborators in the process of establishing standards and defining shop practices, matters which surely affect their interests and well-being fully as much as they affect those of employers and consumers.”
—Mary Barnett Gilson (1877?)
“The unique random blend
Of families and fashions, there
At last begin to loosen.”
—Philip Larkin (19221986)
“Thou hast the keys of Paradise, O just, subtle, and mighty opium!”
—Thomas De Quincey (17851859)