Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Difference of Primary key & Unique Indexes...

Re: Difference of Primary key & Unique Indexes...

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1998/01/03
Message-ID: <34af6ca2.7944183@inet16>#1/1

On Sat, 03 Jan 1998 00:53:57 GMT, cucu_at_nongae.gsnu.ac.kr wrote:

>Hi everybody...
>
>I'd like to know the difference of Primary Key and Unique Index.
>(PK : Primary Key, UI : Unique Index )
>Is there any difference of performance PK and UI?
>or
>what's the particular difference of PK and UI?
>
>Thanks in advance and mail me.
>
>ksjune_at_sys.gsnu.ac.kr

A primary key constraint implies a unique constraint (unique index) + not null on all involved columns. No column in a primary key may be null.

A unique index (unique constraint) allows any or all of the indexed columns to be null.

You can only have 1 true primary key / table.

You can have as many unique constraints as you want. You can simulate >1 primary key by creating unique+not null constraints on columns.  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Sat Jan 03 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US