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: John P. Higgins <jh33378nospam_at_deere.com>
Date: 1998/01/03
Message-ID: <34AE72D7.456@deere.com>#1/1

For a primary key, no column can be null. For a unique key, any column can be null.

Both enforce uniqueness within the entire table.

Adrian Shepherd wrote:
>
> In a nutshell (and probably open to correction)
>
> A Primary key uniquely identifies the record within the entity/table , where
> as a unique index uniquely identifies the column within the record. I have a
> table with invoices , a Primary key on the invoice_id column uniquely
> identifies each record, and prohibits duplicate invoices, whereas a unique
> index on part_number and part_line_number uniquely identifies each line on
> the invoice...Not the best example but I hope it helps.
>
> Regards
>
> Adrian
> cucu_at_nongae.gsnu.ac.kr wrote in message
> <34ad8ad1.347432982_at_news.snu.ac.kr>...
> >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
> >
Received on Sat Jan 03 1998 - 00:00:00 CST

Original text of this message

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