A family tree, What data structure should i use to implement it with asp.net?

  • Thread starter Thread starter amirmoradabadi
  • Start date Start date
Thats a good question. You would want a single person table, but tying everyone together is a bit different. I think you would want Parent/Child all the way down. If the person is a parent, place that ID in the Child record. You could then use application logic to determine grandparents, aunts uncles etc... The simple fact that anyone could only have 1 mother and 1 father simplifies the whole thing. If 2 children only have 1/2 relation it will still be represented in the data.

SO
PersonTable
PersonID,Fname,Mname,Lname etc.., FatherID,MotherID,MarriageID
 
Thats a good question. You would want a single person table, but tying everyone together is a bit different. I think you would want Parent/Child all the way down. If the person is a parent, place that ID in the Child record. You could then use application logic to determine grandparents, aunts uncles etc... The simple fact that anyone could only have 1 mother and 1 father simplifies the whole thing. If 2 children only have 1/2 relation it will still be represented in the data.

SO
PersonTable
PersonID,Fname,Mname,Lname etc.., FatherID,MotherID,MarriageID
 
Back
Top