Hello All,
Here is the situation:
A parent can have many relations (maternal- and paternal grandparents, siblings, father and mother and children). Each of these relations can in turn have zero or more medical conditions. Any single medical condition can be assigned to zero or more relations. OK so far?
I have four tables in my design:
Parent - PK ParentID
Relations - PK RelationID, FK ParentID, Relation
RelationsAndConditions - PK RelationID, PK ConditionID
Conditions - ConditionID, Condition
I'm not sure this is correct. Under the current design if I inserted a record for ParentID = 1 into the relatives table for Maternal Grandparents, the data would look like this:
RelationID Relation ParentID
1 Maternal grandparent
2 Paternal grandparent
3 Father
4 Mother
5 etc...
6
So what would happen to the table if I wanted to insert ParentID = 2 for Maternal grandparent? Obviously there's a problem somewhere. Do I need to further normalise the relations table so that it looks like this:
Relations - PK RelationID, Relation ParentsAndRelations - PK Relation ID, PK ParentID
Would RelationsAndConditions look like this?
RelationsAndConditions - PK RelationID, PK ParentID, PK ConditionID
This is getting very confusing as I'm having trouble visualising how a form-subform would work, if it can be represented by such a structure. Can anyone advise please, either with the normalisation of the tables or the design of a form/subform that would allow for the situation I'm facing.
Thanks for any help.
Here is the situation:
A parent can have many relations (maternal- and paternal grandparents, siblings, father and mother and children). Each of these relations can in turn have zero or more medical conditions. Any single medical condition can be assigned to zero or more relations. OK so far?
I have four tables in my design:
Parent - PK ParentID
Relations - PK RelationID, FK ParentID, Relation
RelationsAndConditions - PK RelationID, PK ConditionID
Conditions - ConditionID, Condition
I'm not sure this is correct. Under the current design if I inserted a record for ParentID = 1 into the relatives table for Maternal Grandparents, the data would look like this:
RelationID Relation ParentID
1 Maternal grandparent
2 Paternal grandparent
3 Father
4 Mother
5 etc...
6
So what would happen to the table if I wanted to insert ParentID = 2 for Maternal grandparent? Obviously there's a problem somewhere. Do I need to further normalise the relations table so that it looks like this:
Relations - PK RelationID, Relation ParentsAndRelations - PK Relation ID, PK ParentID
Would RelationsAndConditions look like this?
RelationsAndConditions - PK RelationID, PK ParentID, PK ConditionID
This is getting very confusing as I'm having trouble visualising how a form-subform would work, if it can be represented by such a structure. Can anyone advise please, either with the normalisation of the tables or the design of a form/subform that would allow for the situation I'm facing.
Thanks for any help.
Last edited: