8
How to create a table with genealogical tree structure for an individual using a concise nomenclature?
Example:
- Individual
- Father
- Father (Paternal grandfather)
- Father (Paternal great-grandfather)
- Mother (Paternal great-grandmother)
- Mother (Paternal grandmother)
- Father (Paternal great-grandfather)
- Mother (Paternal great-grandmother)
- Father (Paternal grandfather)
- Mother
- Father (Maternal grandfather)
- Father (Maternal great-grandfather)
- Mother (Maternal great-grandmother)
- Mother (Maternal grandmother)
- Father (Maternal great-grandfather)
- Mother (Maternal great-grandmother)
- Father (Maternal grandfather)
- Father
Name my case goes a little beyond the example, reaching up to 5° of genealogy.
Related: http://answall.com/q/2425/101
– Maniero
Will this only be for direct relatives (father and mother, grandfather and grandmother)? Or for any relative?
– Guilherme Nascimento
@Guilhermenascimento in my case, only for direct relatives, father and mother of father and mother.
– Lucas Fontes Gaspareto
An idea would be to create a table with only 4 columns
id
,tipo
,nome
,idRelacionada
. Type would be solved in the application layer and define whether it is grandfather or grandmother (can be tynint of 0 and 1).idRelacionada
would be the one who picks up theid
of the cascading "child(a)". I will try to formulate an answer, but I want to put an example with mysql to be clearer :)– Guilherme Nascimento