Both Primary Key and Unique key are used to get records from tables. These keys are also used to create relationship between tables. Primary Key and Unique key both are used to identify records uniquely in a table. A table can have only one primary key whereas unique keys can be multiple in a single table or relation.
Following are the important differences between Primary Key and Unique key.
|Sr. No.||Key||Primary Key||Unique key|
|1||Definition||Primary Key is used to identify all the records in a relation uniquely.||Unique key is also used to identify a records uniquely.|
|2||NULL||Primary key can not have null value.||Unique key can accept one null value.|
|3||Count Wise||Primary key can be only one per table.||Unique key can be multiple in a table.|
|4||Index||Primary key creats clustered index.||Unique key creates non-clustered index.|