Re: Question on Primary Keys

From: Reinier <Reinier_Dickhout_at_hetnet.nl>
Date: Tue, 17 Oct 2000 09:11:13 +0200
Message-ID: <#9QOBnAOAHA.319_at_net025s>


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...
>
My turn hey..?

This is your average master-detail relationship, yes the PK as you've described is correct but I stand with my previous remarks. The PK in this case describes the entity which is an order-line, and thus has a order_no and a line_no. So the PK does not describe the relation, instead there will be a FK consisting of order_no describing the relation with the order_table.

But I think we're about to agree now, aren't we :-) Received on Tue Oct 17 2000 - 09:11:13 CEST

Original text of this message