A SQL Training - Mailing list pgsql-sql

From Devrim GUNDUZ
Subject A SQL Training
Date
Msg-id Pine.LNX.4.44.0207161957450.30332-100000@oper.metu.edu.tr
Whole thread Raw
Responses Re: A SQL Training  (Josh Berkus <josh@agliodbs.com>)
Re: A SQL Training  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
List pgsql-sql
Hi,

Today, one of my teacher asked me a question for a practice... I could not 
solve it :)

Here it comes:

We are given the name of the grandfather in a family. Let's call him A. A 
has n sons, each son has children .

for example.      A -> Grandfather         / \        /   \             B     C      /\   / \ \              /  \ D  E
F          G   H               ...
 

We are given the data like ('A','B'),('C','D')...

Now, we do not know how many children are in the list. How could we list 
this family tree in "tree" formt by only using SQL?

Best regards.





-- 

Devrim GUNDUZ

devrim@oper.metu.edu.tr
devrim.gunduz@linux.org.tr

Web : http://devrim.oper.metu.edu.tr
-------------------------------------





pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Indexing UNIONs
Next
From: Kevin Brannen
Date:
Subject: datatype matrix (was: Re: Sorry..)