Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Family Tree Database

Family Tree Database

Scheduled Pinned Locked Moved Database
databasedata-structures
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vdtrip
    wrote on last edited by
    #1

    Hi, I have a project FamilyTree,it's like a Chain Relation Management.But i have no idea that how i will have to manage Database.Can anybody tell me some ideas for database. VD

    J M 2 Replies Last reply
    0
    • V vdtrip

      Hi, I have a project FamilyTree,it's like a Chain Relation Management.But i have no idea that how i will have to manage Database.Can anybody tell me some ideas for database. VD

      J Offline
      J Offline
      Jorgen Andersson
      wrote on last edited by
      #2

      My first thought was this:

      create table family_relatives (
      relative_id integer primary key,
      spouse references family_relatives,
      mother references family_relatives,
      father references family_relatives,
      -- in case they don't know the exact birthdate
      birthyear integer,
      birthday date,
      -- sadly, not everyone is still with us
      deathyear integer,
      first_names varchar(100) not null,
      last_name varchar(100) not null,
      sex char(1) check (sex in ('m','f')),
      -- note the use of multi-column check constraints
      check ( birthyear is not null or birthday is not null)
      );

      but it lacks a bit. There's no control that your father is male and that your mother is female. And it doesn't keep track on ex-spouses. So one might want to drop the spouse column and add a partner table instead. Keeping track on that your parents are born before you and not dead at your birth is another one. Or at least the mother, the father might actually be dead at your birth

      "When did ignorance become a point of view" - Dilbert

      1 Reply Last reply
      0
      • V vdtrip

        Hi, I have a project FamilyTree,it's like a Chain Relation Management.But i have no idea that how i will have to manage Database.Can anybody tell me some ideas for database. VD

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        SQL Servers hierarchy ID might be an interating tool to use for this.

        Never underestimate the power of human stupidity RAH

        V 1 Reply Last reply
        0
        • M Mycroft Holmes

          SQL Servers hierarchy ID might be an interating tool to use for this.

          Never underestimate the power of human stupidity RAH

          V Offline
          V Offline
          vdtrip
          wrote on last edited by
          #4

          Hi, How can i use this SQL Server hierarchy ID,please can you explain it. Thanks

          J M 2 Replies Last reply
          0
          • V vdtrip

            Hi, How can i use this SQL Server hierarchy ID,please can you explain it. Thanks

            J Offline
            J Offline
            J4amieC
            wrote on last edited by
            #5

            Google broken where you are?[^]

            1 Reply Last reply
            0
            • V vdtrip

              Hi, How can i use this SQL Server hierarchy ID,please can you explain it. Thanks

              M Offline
              M Offline
              Mycroft Holmes
              wrote on last edited by
              #6

              HierarchyID maitains a parent - child relationhip and may make structuring your data simpler. Do a bit of research in BOL.

              Never underestimate the power of human stupidity RAH

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups