1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how to make a working Pedigree/hierarchy all generations

Discussion in 'Databases' started by Jimmy_bra, Feb 19, 2019.

  1. #1
    The data is of dogs but i think many of the same functions apply as for a familytree of people.
    I have at table of data looking like this :
    Name ;Reg;Reg_Father;Father;Reg_mother ;Mother ;Born;Count
    Prince;NO34567;NO12345;King;NO23456 ;Queen;

    The primary key is the value "Reg" and this relates to "Reg_father" and "Reg_mother" this are all known values. "Name" is related to "Reg" in the same way "Reg_father" is to "Father" and "Reg_mother" is to "Mother"

    What i like to do is
    1. to be able to make a "familytree" and to list commen ancestors
    2. how many times these ancestors appear in the lines. Name or Reg with a count behind.

    any idees of best way to achieve this goal?

    Last edited: Feb 19, 2019
    Jimmy_bra, Feb 19, 2019 IP
  2. sarahk

    sarahk iTamer Staff

    Likes Received:
    Best Answers:
    Trophy Points:
    I'd probably add an id field to the table and let the kennel club number be information rather than the primary key.

    1. Creating the family tree is a well document process - look for tutorials on parent_id and traversing the tree.
    2. counting how many times an ancestor appears would be a run time query and not something you save on the database.
    sarahk, Feb 19, 2019 IP