Click to See Complete Forum and Search --> : Simple Database design issue


MartinN
October 31st, 2002, 10:27 AM
This is the simplifying I'm trying to accomplish:

I have a table called Past and another table called Current.
Both have a number of attributes that are unique to their respective table's,
but they both have an attribute called Allergies with other attributes that are associated with the Allergies attribute.
My question is: If I were to create a table called Allergies and put the associated Allergies attributes in it,
how am I to know which table this record belongs to? Past or Current?

Thanks, Martin

Athrarn
October 31st, 2002, 11:03 AM
I see 2 ways to do it

If u are using constraints discard de last way.

First way is add two foreign keys both nullables to the allergic table. each one with the primary key of each other two tables.

The second one is one non foreign constrained column pointing o the keys of the other too.

I wish i had explained what i wanted to say.

good luck

MartinN
October 31st, 2002, 12:59 PM
I was just reading about the CONTSTRAINT clause and it looks like
the thing I need.
Thanks, Martin