Subject | Re: [IBO] Many to many rel. |
---|---|
Author | pepmallorca |
Post date | 2002-02-12T21:11:42Z |
I'm agree with Og,
If the id of A, and the id of B identifies the relation C, you don't
need another identifier. I will be redundant.
The primary key of C could be the A-B combination.
C(idA,idB)
idA of C will be a foreign key of the A table and
idB of C will be a foreign key of the B table
Usually you will be interesting in other information for completing
the C table.
This is not a mathematical rule. You'll have to choice.
Another problem will be the synchronization of the two queries when
you update the A table, and the B table. The IB_QUERY component has
a MasterSource property (for an unique Master, not 2 like in your
case), the other will be detected when you change the information...
A little more dificult...
Bye,
If the id of A, and the id of B identifies the relation C, you don't
need another identifier. I will be redundant.
The primary key of C could be the A-B combination.
C(idA,idB)
idA of C will be a foreign key of the A table and
idB of C will be a foreign key of the B table
Usually you will be interesting in other information for completing
the C table.
This is not a mathematical rule. You'll have to choice.
Another problem will be the synchronization of the two queries when
you update the A table, and the B table. The IB_QUERY component has
a MasterSource property (for an unique Master, not 2 like in your
case), the other will be detected when you change the information...
A little more dificult...
Bye,
--- In IBObjects@y..., "Martijn Tonies" <m.tonies@u...> wrote:
> Hi,
>
>
> ""og"" <og > wrote in message news:00b901c1b3e9$13b3d8f0
$8bf2a8c0@VS5510...
> > Hi, I'm wondering if there is someone who can guide my in making
a many to
> > many relationship work.
> >
> > I have three table's:
> > Table A: aid integer, bName string, bTel string
> > Table B: bid integer, bName string, bTel string
> > and then the connecting table
> > Table C: cid integer, aid integer, bid integer
> >
> > Do I need cid in table C?
>
> If you can identify records in C by AID and BID, I would leave out
CID - it
> has no use the. But this is only possible if the combination AID
and BID is
> unique - but I guess it is.
>
>
> --
> Martijn Tonies
> InterBase Workbench - the developer tool for InterBase and Firebird
> http://www.interbaseworkbench.com
>
> Upscene Productions
> http://www.upscene.com
>
> "This is an object-oriented system.
> If we change anything, the users object."