473,748 Members | 2,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2186
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
19486
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
3818
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
3661
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 names and natinalties in a hierarchy fashion, begiing with our own name and nationality.Include capabilities for modifying the tree and for adding new names to the tree.Also, include a provision for displaying the entire tree automatically after...
1
3651
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. Links, sugestions are welcome. Thanks Marek
15
2682
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 presentation comparing using a relational database vs. a native XML database within a content management system to manage XML-based documentation. The point I am trying to make is how difficult it can be to reconstruct the XML hierarchy/tree once the...
18
5155
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 relate to the childrem ?
1
2729
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 would like a visual representation of this relationship based on the values in my database showing the hierarchy much like a site map or family tree. Can anyone recommend how I could do this or suggest a software?
3
1864
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 inherited? That is, if i have a font-family in a parent div, and I specify 'font-family:"some font" in a child div, will the child also inherit the parent div's font-family if an instance fails to locate the child's specification? - in the sketchout...
4
5736
by: lokeshyourfriend | last post by:
i need code for creating family tree in php.
0
8983
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8822
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9528
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9310
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9236
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8235
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6792
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
2774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.