RE: [Q] what difference between PK and unique index + not NULL??

  • From: "Jacques Kilchoer" <Jacques.Kilchoer@xxxxxxxxx>
  • To: <mccdba1@xxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 18 Jan 2005 11:27:49 -0800

If I put a PK constraint on columns A and B, I don't need a separate not
null constraint on those columns to prevent null values in those
columns. With a unique constraint on columns A and B, I would need
additional not null constraints to prevent null values in those columns.

Another difference is that a table can have only one primary key
constraint but several unique constraints.

Some third-party software tools might require you to have a primary key
constraint to do certain operations on a table.

The Oracle optimizer might view a PK constraint differently than a
unique constraint on not null columns, one of the performance experts on
the list could probably say a word or two about that.

Finally, there are probably some theoretical design considerations that
say your model should have a PK for each table.

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of dba1 mcc
Sent: mardi, 18. janvier 2005 10:59
To: oracle-l@xxxxxxxxxxxxx
Subject: [Q] what difference between PK and unique index + not NULL??

I have some argued with contractor about Primary key
and Unique index +  Not NULL.  Contractor said Primary
Key =3D  (field specify NOT NLL and create unique index
..).  I rember some documents say Primary Key and
(unique index, not null) still some different.

Does anyone have opinion?

--
//www.freelists.org/webpage/oracle-l

Other related posts: