Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Difference of Primary key & Unique Indexes...
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
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
![]() |
![]() |