UNIQUE constraint and PRIMARY key?

Asked By 0 points N/A Posted on -
qa-featured

Our professor in Database 2 assigned us to make some small system. We were required to use MS Access as our mode of database storage. Now, after he discussed on what to do, I'm just a little confused between unique constraint and primary key. Is there any differences between these two entity? 

SHARE
Answered By 0 points N/A #96324

UNIQUE constraint and PRIMARY key?

qa-featured

Unique and Primary keys are very confusing but if you look at it in a logical way there are differences in its nature. 

For one a primary key cannot be null it can only accept “not null values” while a Unique Key can accept null values. Also in a given table, you can have many unique keys but you can only have one primary key. 

Also a Unique key column applies no constrains except for the fact that no duplicates are allowed on that column, while a Primary Key column has a constraint that the value should not be null and that there are no duplicates and an ascending order is followed.

Related Questions