Interviews4 answers
What is the difference between PRIMARY KEY and UNIQUE KEY with NOT NULL constraint?
4 Answers
primary-single, auto increment,not null,one primary key allowed
unique-nullable,allowed unique key more,
RajaGopal GcePosted Jan 20, 2017, 9:08 PM EST
Hi.
in data level we have:
Primary key = unique identifier of a row in DB & is NOT NULL.
Unique key = unique identifier of a row in DB & is NULL ABLE.
in perfect design model we have:
Primary key = unique identifier of an entity and is meaningless.
Unique key = unique identifier of a entity and is meaningful.
Petra ZeilerPosted Mar 29, 2007, 8:53 AM EDT
the primary diffrence bitween primary key & unique key is when we assign primary key to a particular column cluster index automatically created for that column.
primary key= unique +not null+ clustered index
ragi01Posted Mar 26, 2007, 8:23 PM EDT
Both of them are same.
we can say primary key=unique key+not null
prasad mummidiPosted Mar 26, 2007, 7:01 AM EDT
