difference between primary key and Unique key

  • Hi,

    I have come across interview microsoft. I have been asked for the difference between primary key and unique key.

    I have given answer that Unique key allows one null where as primary key wont allow nulls.

    the interviewer asked if i made unique key along with not null they is that equals to primary key??

    What should be the answer. Please reply me.

     

  • The answer is a unique key creates a nonclustered index by default

  • what about referential integrity - primary key foreign key relationships.

    if you build these relationships on unique indexes (not keys) then products like MSACCESS would not be able to update queries where there is a join.

    MVDBA

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply