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 U.S. is becoming an increasingly fatherless society. A generation ago, an American child could reasonably expect to grow up with his or her father. Today an American child can reasonably expect not to. Fatherlessness is now approaching a rough parity with fatherhood as a defining feature of American childhood.”
—David Blankenhorn (20th century)
“The unique random blend
Of families and fashions, there
At last begin to loosen.”
—Philip Larkin (19221986)
“And yet we constantly reclaim some part of that primal spontaneity through the youngest among us, not only through their sorrow and anger but simply through everyday discoveries, life unwrapped. To see a child touch the piano keys for the first time, to watch a small body slice through the surface of the water in a clean dive, is to experience the shock, not of the new, but of the familiar revisited as though it were strange and wonderful.”
—Anna Quindlen (b. 1952)