RSS Feed

Difference Between Unique & Primary Key

Difference Between Unique & Primary Key

You can have more than one UNIQUE constraint per table, but only one Primary key.

Some DBMS might automatically create an index (data structure to speed search) in response to PRIMARY KEY, but not UNIQUE.

SQL does not allow nulls in Primary key, but allows them in Unique columns (which may have two or more nulls, but not repeated non-null values).