Re: Table acting as a relation table

From: Lennart <erik.lennart.jonsson_at_gmail.com>
Date: Wed, 11 Apr 2007 21:06:48 +0200
Message-ID: <evjbk8$v7g$1_at_registered.motzarella.org>


Guy wrote:
> On Apr 11, 1:07 pm, Lennart <erik.lennart.jons..._at_gmail.com> wrote:
[...]

>> Why [HOSP_CODE, CLINIC_CODE] as primary key?
>>
>> /Lennar

>
> A clinic code can only be linked to one and only one hospital. I could
> enforce this by code, but it is customary in my company to create a
> primary key to enforce this, and it helps the QA and support
> understand the validity rules of a table.
>

No no, you should definitely have a primary key, but why not CLINIC_CODE as suggested in this thread? [HOSP_CODE, CLINIC_CODE] does not enforce your rule "A clinic code can only be linked to one and only one hospital"

/Lennart Received on Wed Apr 11 2007 - 21:06:48 CEST

Original text of this message