473,394 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Representating a family tree

Hi,

Are there any built in or known structures I can use in Postgres to represent a family tree?

The usual tree representations in SQL are for regular hierarchy of data, but on a family each node had usually 2 parents and a few child nodes. What will be the best way to represent something like this in an efficient manner?

Guy.

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
1 2144
On Sun, 29 Aug 2004 Guy Naor wrote
Hi,

Are there any built in or known structures I can use in Postgres to represent a family tree?
I'll go out on a limb here. Not really, but, ...
The usual tree representations in SQL are for regular hierarchy of
data, but on a family each node had usually 2 parents and a few child
nodes. What will be the best way to represent something like this in an
efficient manner?


Well, the way I have usually done this is a table of individuals, a
table of marriages, and one or more relationship tables.

Some people would reduce the number of relationship tables by including
an entry for the first child in the marriage record, and including an
entry for the next younger sibling in the individual record. I think I
prefer to use the relationship records for all relationships.

Further details would depend heavily on what you might mean by "marriage"
or "family". For instance, do you only want to deal with family of last
official record, or do you want to record the birth parents and maybe
even all adoption/foster relationships? Etc. These decisions would
determine the number and structure of the relationship records,
essentially.

Anyway, as far as I know, there is no family tree type structure in
PostGreSQL. (I can't think of any database except a custom database that
would have such a data structure, even though we use a simplification of
the family tree for all sorts of data models.) But PostGreSQL does have
tables, and you can use tables to model a family tree.

My JPY 2.

--
Joel <re**@ddcom.co.jp>
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Fabian Neumann | last post by:
Hi! I got a problem with font-family inheritance. Let's say I have CSS definitions like: p { font:normal 10pt Verdana; } strong { font:normal 14pt inherit;
3
by: Skumar | last post by:
Hi, Please any one help me, Simple tcp/ip program in c with IPV6 address family Advance thanks, Skumar.
8
by: marar.harish | last post by:
I need the following programs: Q. Write a c program that will allow you to enter and maintain a computerized version of your family tree.Begin by entering the number of generation.Then enter the...
1
by: mark | last post by:
Hi everyone, I'm wondering if anyone knows about any dotnet project (site) concerning a family tree. I'm especially intrested in how to get down to such a project and use asp.net controls....
15
lwwhite
by: lwwhite | last post by:
I'm not sure if this discussion is a better fit for the Access or XML forum and I don't want to double-post, so I'm starting in Access because you've been so helpful to me here. I am preparing a...
18
by: Cliff Chapin | last post by:
I want to create a Family database some of these "families " are single fathers with children some are single women with children they will be assigned Rooms /w children. what would be the best to...
1
by: bcap | last post by:
Hi, I am looking for a software that can generate a tree of data. For example, I am trying to track real estate relationships like a lessor, tenant, general contractor, and subcontractors. I...
3
by: redslider | last post by:
now for my dumb-question (i note the other forum on 'inheritance' is closed): my question is about inheriting text properties, and specifically, if font-family values can be cumulatively...
4
by: lokeshyourfriend | last post by:
i need code for creating family tree in php.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.