Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

diff b/w primary key and unique key?

Former Member
0 Kudos

what is the diff b/w primary key and unique key?

5 REPLIES 5

Former Member
0 Kudos

Hi,

Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn’t allow NULLs, but unique key allows one NULL only.

Hope it was useful.

Thanks,

Sandeep.

0 Kudos

Hi,

With respect to functionality both are same.

But in ABAP we only have Primary key for the Database tables declared in the Data Dictionary.

Unique is generally is the term used with declaring key's for internal tables.

Both primary and Unique keys can identify one record of a table.

Regards,

Sesh

Former Member
0 Kudos

Hi,

Primary Key and Unique is also same but only one difference,

1. We can create Foreign key with reference of Primary key, but we could not create Foreign key with reference of Unique.

IF USEFULL REWARD

Former Member
0 Kudos

hi

P.K is used to fetch a record uniquely.

will not accept null character.

a table can have only one primary key.

Unique key is used to fetch a record selectively.

it accepts null char for one row..

except null char operations are same.

reward if useful.

Former Member
0 Kudos

hi.

primary key doesn’t allow NULLs, but unique key allows one NULL only.

We can create Foreign key with reference of Primary key, but we could not create Foreign key with reference of Unique.

Reward all helpfull answers.

Regards.

Jay