Parent-Child table relationships [message #970] |
Mon, 23 July 2007 12:02 |
adamsp
Messages: 32 Registered: July 2007
|
Member |
|
|
I have several tables with Parent-Child structure. Some allow a single record for the Parent-Child combination.
Tables: FAMILY, PERSON, FAMILY_PERSON
Desired outcome:
Each FAMILY_PERSON record must
refer to an existing record in FAMILY
refer to an existing record in PERSON
each FAMILY+PERSON combination can exist only once.
My implementation uses 3 keys:
foreign key to FAMILY from FAMILY_PERSON
foreign key to PERSON from FAMILY_PERSON
primary key in FAMILY_PERSON on FAMILY+PERSON
In Radicore, from the FAMILY_PERSON table, when I go to add a relationship to setup the foreign-key to FAMILY (or PERSON)...after I click "submit" and then get to "update" (relationship), I always presented with BOTH family and person...to set the references to both...presumably because this is the primary key. But I only want to enter the family (i.e. to validate that the family record exists in the FAMILY table).
Am I doing this correctly? How can I set this up these table relationships in Radicore?
|
|
|
|
|
Re: Parent-Child table relationships [message #973 is a reply to message #972] |
Tue, 24 July 2007 07:35 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
In all the data modeling tools that I have used it has always been the practice to define one-to-many relationships starting from the "one" entity. The primary key field(s) of the "one" entity are then pre-selected, which you then have to link manually to the corresponding foreign key fields in the chosen "many" entity.
Radicore does not use foreign key constraints, therefore it cannot identify foreign key fields automatically.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|