What is the difference b/w unique and primary key?
For Starters:- Unique key can have a null value in the column and you can have multiple column's having unique key assigned to them. Primary key can only be one in the table and cannot contain null values.
1. Primary key is made up of a column or set of columns that identifies a record uniquely in the table. Unique key ensures non duplicate value in the column across records. 2 Primary key or any of its part can't be left empty. But Unique column can have null value unless it told not to allow nulls. 3. There can only be one primary key per table. But a table can have multiple unique keys.