What is the difference between unique key and primary key?

Asked By 10 points N/A Posted on -
qa-featured

What is the difference between unique key and primary key?

SHARE
Best Answer by John10
Answered By 0 points N/A #96809

What is the difference between unique key and primary key?

qa-featured

A UNIQUE constraint is similar to PRIMARY key, but you can have more than one UNIQUE constraint per table.

Best Answer
Best Answer
Answered By 0 points N/A #96810

What is the difference between unique key and primary key?

qa-featured

After clearly reading your question the following is the notable difference between the two items.

·         A unique key although similar to a primary key can contain more than one unique constraint in a given table whereas a primary key cannot

·         A unique key accepts null values whereas a primary key does not

·         A unique key is used for the purpose of preventing duplication of key values within a given row of a table as well as allowance of null values whereas the primary key is used to uniquely identify a given row in a table as well as ensuring that no duplicate rows exist

·         Non-clustered indexes are never created in unique key whereas they are created in primary key

Answered By 0 points N/A #96811

What is the difference between unique key and primary key?

qa-featured

unique key can contain null value but primary key cannot

Login/Register to Answer

Related Questions