Re: three table join

Поиск
Список
Период
Сортировка
От Sean Davis
Тема Re: three table join
Дата
Msg-id DF10E4BC-2CFD-11D9-807B-000A95D7BA10@mail.nih.gov
обсуждение исходный текст
Ответ на Re: three table join  (Kumar S <ps_postgres@yahoo.com>)
Список pgsql-novice
On Nov 2, 2004, at 12:56 PM, Kumar S wrote:

> Hello Oliver,
>  Thank you for your mail with suggestions. I decided
> to keep the con_exp_id as primary key because of the
> fact that a contact can do as many experiments as he
> can and one experiment can be done many contacts.
> Thus these two tables share a Many to Many
> relationship.
>
>
> Thus for other tables con_exp_id will be made as
> Foreign key .
>
> For example:
>
> Table: Chip_table
> chip_id (PK)
> con_exp_id (FK)
> ......
> .....
>
> Here it is easy for me to anchor con_exp_id as FK from
> con_exp_link table.
>
> Any other better alternative?
>
> Thanks
>
> Kumar
>

Kuman,

This implies that you will have a row in the chip table for every
con_exp row, so you wouldn't need the con_exp table at all?  Probably
what you mean is that for every con_exp row, there are foreign keys
referencing the primary keys in your chip and contacts tables?  That
gives you the many-to-many relationship and guarantees that you have an
entry in both the contacts and chip tables for every row in the con_exp
table.

Sean


В списке pgsql-novice по дате отправления:

Предыдущее
От: Kumar S
Дата:
Сообщение: Re: three table join
Следующее
От: Andrew Hammond
Дата:
Сообщение: Re: [SQL] Log