What is primary key and unique key in SQL server?

This is one of the important and confusing question for the candidates, so guys be careful while answering this question.

Note: Always remember that do not give the scope to ask more questions so be clear practically.

Primary Key: The  primary key is nothing but a combination of NOT NULL and UNIQUE key. It does not allow null values and duplicate values.


  • One table will have only one primary key.
  • If you create primary key on the column that means data stored in an order (clustered index)

Unique Key: Unique key also does not allow duplicate values, but it allows only one null value.


No comments:

Post a Comment

What is Normalization?

Database normalization is a data design and organization process applied to data structures based on rules that help building relational dat...