Below it?s a simple schema to easy understand the difference between the primary key and unique key.

For detailed information check the online Microsoft documentation.

Primary Key is a combination of Unique and NOT NULL Constraints so it can?t have duplicate values or any NULL. So, if the Unique key is defined on not null column(s), then it is essentially the same as the Primary Key and can be treated as an alternate key meaning it can also serve the purpose of identifying a record uniquely in the table.


No feedback yet