Pages

Sunday, February 1, 2009

differences between primarykey and uniquekey

One of the basic question in any interviews is What is the difference between primary key and unique key?

Just give the below ponts, he/she will be very happy with the answers.

The Major differences between Primary Key and Unique Key are:

1) Primary Key doesn't allow null values, But Unique key does all nulls(Only One per key).

2) You can have No.Of Unique Keys on a single table, but you can have atmost only one primary key.

3) Primary Keys are used to define Referential Integrity Constraints.

No comments: