Is there any difference between the primary key and unique key?

Sharad Jaiswal
Sharad Jaiswal

Posted On: Feb 22, 2018

 

There is, of course, a difference between the primary and unique key

Primary key

  • It enforces the uniqueness of column in a table.
  • It does not allow the nulls.
  • It chooses default cluster index

Unique key

  • It allows one null value.
  • It doesn't enforce uniqueness of a column in a table.
  • It chooses a default non clustered index.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    SQL Server Interview Questions

    What are a database and a data warehouse?

    A database, in general, is a collection of information in a more organized form for better access...

    SQL Server Interview Questions

    What is normalization according to you and explain its different levels?

    In order to remove the redundant data, normalization is used. It also reduces the null values and enables the efficiency of indexing...

    SQL Server Interview Questions

    What do you understand by the denormalisation?

    Denormalization is the inverse process of normalization...