Re: Table acting as a relation table

From: David Cressey <cressey73_at_verizon.net>
Date: Wed, 11 Apr 2007 11:22:11 GMT
Message-ID: <Dx3Th.8814$FC5.5529_at_trndny06>


"Lennart" <erik.lennart.jonsson_at_gmail.com> wrote in message news:evi18m$lqb$1_at_registered.motzarella.org...
> David Cressey wrote:
> [...]
> > What Marshall said, and also this:
> >
> > If you make (HOSP_CODE,CLINIC_CODE) the key to the T_HOSPITAL_CLINIC
table,
> > this would have the effect of preventing the same entry from being
entered
> > twice into this table.
>
> I also thought this was what the OP meant in his first post. As Bob
> pointed out, it makes more sence to use CLINIC_CODE alone as the key in
> T_HOSPITAL_CLINIC.
>
Given the OP's second post,

"A clinic can be in any hospital, but only if its not already assigned to another hospital. My physical example could be misleading. I am dealing with administrative regroupings, rather than real physical entities."

I agree.

> > This is generally a "good thing". Relations cannot
> > have duplicate tuples, by definition. By preventing the table from
having
> > duplicate rows, you cause the behavior of the table to be more
congruent.
> >
> > I would take your expert's advice to create separate key column for each
> > table with a very large grain of salt. I believe that's bad general
advice,
> > and I think Marshall and Bob are also saying that.
> >
>
> Agreed
>
> /Lennart
Received on Wed Apr 11 2007 - 13:22:11 CEST

Original text of this message