Can you use UNIQUE KEY as a replacement for Primary Key ?

  • Both Keys are different. For Identifying each and every record in a table we use primary key.
  • To apply additional uniqueness for other columns on the table we use Unique Key.
  • Primary Keys are important for a table.
  • Internal users use Primary Key whereas external users use unique key as it contains some meaningful information.
  • When uniqueness is needed for multiple columns for a table, we use unique key for all columns and primary keys cannot be used in this case.
  • Primary key uses clustered index by default and unique key uses Non-clustered index.

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Char vs Varchar in SQL

Char VarChar Char data type is used for storing single character values It is a SQL Code that helps in storing variable character Used to store characters string of fixed…
View Answer