4
Reply

What is the difference between PRIMARY KEY and UNIQUE KEY with NOT NULL constraint?

Anantha Narayanan

Anantha Narayanan

Mar 26, 2007
10.3k
0

    primary-single, auto increment,not null,one primary key allowed unique-nullable,allowed unique key more,

    RajaGopal Gce
    January 21, 2017
    1

    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 Zeiler
    March 29, 2007
    0

    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

    March 27, 2007
    0

    Both of them are same. we can say primary key=unique key+not null

    prasad mummidi
    March 26, 2007
    0