Basically both constraints will share a common property called uniqueness. The data in the column should be unique. The basic difference is-
- Primary key won’t allow null value. Whereas, unique key will accept null value but only one null value.
- On creating primary key, it will automatically create the clustered index on the table. but in case of Unique key it created Non-Clustered Index on table.
- Only one primary key can be created for the table. Any number of Unique key can be created for the table.