What is the difference between “Primary Key” and “Unique Key”?

375 viewsSQLSQL
0

1. We can have only one Primary Key in a table whereas we can have more than one
Unique Key in a table.
2. The Primary Key cannot have a NULL value whereas a Unique Key may have only
one null value.
3. By default, a Primary Key is a Clustered Index whereas by default, a Unique Key is a
unique non-clustered index.
4. A Primary Key supports an Auto Increment value whereas a Unique Key doesn’t
support an Auto Increment value.

Gautam Sarswat Changed status to publish January 11, 2023
Write your answer.

Recent Replies

Web Stories

Forum Statistics

Registered Users
3,611
Forums
6
Topics
70
Replies
113
Topic Tags
69
Empty Topic Tags
244

Posted

in

Tags:

Comments

Leave a Reply

A Tribute to Dilip Kumar