Home » SQL & PL/SQL » SQL & PL/SQL » What is the difference primary key and unique key with not null constraint
icon9.gif  What is the difference primary key and unique key with not null constraint [message #222510] Mon, 05 March 2007 04:36 Go to next message
Khaderbasha
Messages: 3
Registered: March 2007
Location: Bangalore
Junior Member
What is the difference between having a primary key on column 'A' and having a unique key and not null constraint on column 'A'

[Updated on: Mon, 05 March 2007 04:37]

Report message to a moderator

Re: What is the difference primary key and unique key with not null constraint [message #222514 is a reply to message #222510] Mon, 05 March 2007 04:46 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Data Integrity.
Re: What is the difference primary key and unique key with not null constraint [message #263273 is a reply to message #222510] Wed, 29 August 2007 10:13 Go to previous messageGo to next message
pvannapurna
Messages: 8
Registered: October 2006
Location: Hyderabad
Junior Member
Primary Key -
1.wont accepts null values
2. for one table we can have one p.key

Unique Key -
1. It considers null values
2. we can have more than one unique key per table
Re: What is the difference primary key and unique key with not null constraint [message #263284 is a reply to message #263273] Wed, 29 August 2007 10:38 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Why this answer is better than the previous link?
Why posting this 6 months later?

In addition you didn't read CAREFULLY the question.
OP said UNIQUE KEY + NOT NULL.

Regards
Michel

[Updated on: Wed, 29 August 2007 10:39]

Report message to a moderator

Previous Topic: can we write a "SWITCH" statement in PL/SQL block?
Next Topic: CompositeKey
Goto Forum:
  


Current Time: Sat Dec 10 04:50:49 CST 2016

Total time taken to generate the page: 0.08815 seconds