Structuring Infinite Parent->Child schema

I need to create a procedure which will allow to build a Parent/Child schema. To simplify the question I will post an example here:

  1. Say we have a distributor who sells products (i.e Tom). Tom UserID=1
  2. Tom has 3 people signed under his name: Christina (with UserID=5), Jerry(with userID=12) and George(with UserID=45)
  3. Christina signed 2 people under her name. Adam(UserID=34) and Mark(UserID=36)
  4. Mark signed 3 other people and Adam signed 6 other people,…etc.etc…

I hope you see where am I going…

I need to create a table struvture to implement this procedure so at any given time the App can show the whole structure (like a tree)
For example I will show

[ATTACH=CONFIG]n71335[/ATTACH]

I have some ideas how ti design the database for this but I haven’t done something like this before so need some opinions from those who did
I wonder if anybody has implemented this structure and what is the best practice ?

here is an image showing the graphical chart

ART

tree.jpg

  1. Version (2 Tables)

Table: Person
ID as Primary Key ---------±-----+
field2 | |
… | |
… 1:n| 1:1
| |
| |
Table: Relation | |
Dad <-----------------------------+ |
Son <-------------------------------------+

  every dad can have 1 to many sons
  every son has exactly one dad
  
  Depending on your database system you can define a primary key as (dad & son) on your Relation table
  1. Version (1 Table)

Table: Person
ID as Primary Key
DAD-ID (holds the ID of Dad or NULL if it is “ADAM” :wink: )
… Rest of fields

Thanks Jens
OK, I think I have an idea on how to structure the tables but the next question is how to create a presentation grid which shows data in the form as on the image (either vertically or horizontally ) (?)

I would think you must create it with the menu control, when a user cliked on a option, it show a form with data. If is for a multilevel, i think is good idea only show the leg requeried, Not all the tree.

I have seen some web app with excellent feature allowing to open specific leg with a + sign and collapse it by clicking again. IT is kinda of the similar way that Properties panel is build in SC (left panel) with the exception that there could be many, many levels (legs). The site that I 'm referring to allowed to open at least 30+ legs at the same time so the tree was expanding accordingly to the + sign clicked. At some point it looked similar to the structure on the image I posted.

I really do not know how to do it in SC. The SC properties panel is hard coded and in case of the levels/legs this all has to be data driven so the number of legs will grow when the number of child records will grow.
Fore me it doesn’t have to have graphical form (with icons, lines etc…) but it needs to show relations somehow.

Art