What is the need of primary key as opposed to using not null and unique ?

We can create a column with' not null+unique' with out using primary key

Questions by sreeraghava.nara

Showing Answers 1 - 16 of 16 Answers

ashu.gupta

  • Jul 2nd, 2009
 

Along with the answers mentioned above

To add cascading is only possible when it follow primary key - foriegn key constraint.

  Was this answer useful?  Yes

Radha

  • Jul 14th, 2011
 

We can create NOTNULL and UNIQUE constraints on single column. Which indirectly means a Primary Key.
But only a Primary Key column can be used as Foreign key column.
Primary key provides a default index in it. But we don't have this advantages on the column which we have NOTNULL and Unique Key instead of Primary Key.

  Was this answer useful?  Yes

PRADEEP

  • Oct 17th, 2012
 

Primary key: set of columns is uniquely identified a rows of a table.

It does not allow both nulls and duplicate values.

If we use null values it will allow duplicate values but it does not allow null values.

If we use unique key it does not allow duplicate value but it allows null values.

The main difference is if we use primary key it does not allow both null and duplicate values.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions