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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Question on Primary Keys

Re: Question on Primary Keys

From: <rs>
Date: Tue, 17 Oct 2000 11:02:43 +0530
Message-ID: <sunp5nebkfmn2f@news.supernews.com>

I know that (OrderNum, LineNum) should semantically be the PK.

What if the following were done :

    set OrderLineID as the PK for the ORDERLINE table, and have OrderNum as a FK.

By doing that, am I helping myself in terms of efficiency with indexing in any way or
is there no real benefit from doing that?

If I wanted to go forward with the approach I described, how would I set up a unique
sequence in Oracle in order to accomplish this ?

Raju

"Jan Lenders" <J.Lenders_at_Betuwe.net> wrote in message news:8sfc8l$ncm$1_at_nnrp1.deja.com...
> Okay, but what about an ORDERLINE table, which is dependent on a ORDER
> table.
> ORDER (PK OrderNum)
> ORDERLINE (PK OrderNum, LineNum)
> LineNum is unique per OrderNum and does not have to be unique within
> the ORDERLINE table.
>
> Your turn...
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Tue Oct 17 2000 - 00:32:43 CDT

Original text of this message

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