difference between unique key and primary key

There is two difference between them.

1. The not null constraint is by default added to primary key, it means, primary key attribute cannot accept null values, whereas, the attribute declared as unique can accept null values. It is the major difference between the two.

2. Secondly, we can have only one primary key in a relation, whereas, multiple attributes can be declared unique at the same time.

Read more: http://wiki.answers.com/Q/What_is_difference_between_unique_key_and_primary_key#ixzz1zlIl5kQh

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s