![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a database with individuals in it, and I'd like to store their kin relationships also. A quick, clumsy way of doing it would be to have three columns: two for individuals, and the third expressing their relationship (e.g. 'a is sibling of b', 'a is parent of b', etc). But that's clumsy and has redundancies. Does anyone know of a clean, efficient way to store this information? (I assume it would involve modelling a tree or graph.) |
#3
| |||
| |||
|
|
I have a database with individuals in it, and I'd like to store their kin relationships also. A quick, clumsy way of doing it would be to have three columns: two for individuals, and the third expressing their relationship (e.g. 'a is sibling of b', 'a is parent of b', etc). |
#4
| |||
| |||
|
|
In short, there is no known "clean, efficient way to store this information" in the relational model that satisfies all constraints. If you have a highly restricted universe (no divorce or remarriage), you might be able to solve your representation problem relationally. |
#5
| |||
| |||
|
|
I [john] was married and had a son [bob]. He [bob] married and had a daughter [sue]. My wife [mary] died. I [john] married my son's [bob] daughter [sue]. Now I [john] am my own grandfather. Try resolving that relationally! |
#6
| |||
| |||
|
|
For example, suppose you have 5 tuples in 1 (person) or 2 (parent, child) relations corresponding to father "A" and childs (children!) B,C,D and E. Suppose A is father to all 4 childs B,C,D and E by two marriages: B and C offspring of the first marriage, D and E offspring of the second. How can you represent the parent-child relationships so that the step- sibling relationship is preservered? (I.e., so that B and E have the same father, but are not siblings.) |
#7
| |||
| |||
|
|
On Aug 21, 8:21 am, Rob <rmpsf... (AT) gmail (DOT) com> wrote: In short, there is no known "clean, efficient way to store this information" in the relational model that satisfies all constraints. If you have a highly restricted universe (no divorce or remarriage), you might be able to solve your representation problem relationally. There are 2 relations, which can be organized as trees: Biological_Mother( parent, child ) Biological_Father( parent, child ) That is all to it. You can derive siblings informations from these base tables. You can introduce extra relations, like Marriage( individual1, individual2 ) but the assertion that "no known clean, efficient way to store this information in the relational model" is clearly BS. |
#8
| |||
| |||
|
|
if it can be stated as a proposition, it can be stored in a relational database... |
#9
| |||
| |||
|
|
Does anyone know of a clean, efficient way to store this information? |
![]() |
| Thread Tools | |
| Display Modes | |
| |