Difference between Primary key and Unique Key


Primary key
Unique Key
1-      Primary key doesn’t have a null value.

2-      A table can have only one primary key.

3-      By default primary key has a clustered index.
The unique key can hold null value but only once.

A table can have more than one unique key.

By default, the Unique key has a non- clustered index.


No comments:

Post a Comment

Please do not enter any spam link in the comment box.

Related Posts

What is the Use of isNaN Function in JavaScript? A Comprehensive Explanation for Effective Input Validation

In the world of JavaScript, input validation is a critical aspect of ensuring that user-provided data is processed correctly. One indispensa...