Difference Between Unique Key and Primary key in sql

Hello Everyone,

Everyone knows who is/was worked on SQL. this is easy question but in interview this questions may be asked and interviewer asked this question for anyone whether he/she is fresher or experienced. this is very basic questions for all the IT person.

Unique Key

1.unique key allowed null value and is used to prevent the duplication of key value.

2.non clustered index is created using unique key.

3.we can define more than one unique key of table.

4.unique key can be accepted null value.


Primary Key

1.we can set only one primary key of table.

2.we cant set primary key as a null.

3.clustered index can be created using primary key.

4.primary key allows each row in table to be uniquely identify and check for no duplicate rows exist.