Given a group of people - in which some people are subordinate to 
others - how can I best store that information and then retrieve it 
so that the relationship information is clear and so that 
relationships can be easily changed (i.e. one person is promoted).

Simplicity tells me that ALL of the people should be stored in the 
same table, and that their relationships should be defined by a field 
or fields within the database.

So if we have:

                Jane Smith
                     |
                     |
         John Doe ________ Linda Brown
                                 |
                                 |
                    Bill Smith ______ James Smith


(1)   How can I best set up a database to indicate the relationships
       so that they can be extracted easily with DBI?

(2)   In perl/DBI, what's the simplest approach to outputting this
       data in the form of a report, so that:

       Jane Smith
             Linda Brown
                  Bill Smith
                  James Smith
             John Doe
             etc....

I have a couple of projects in which this sort of data storage could 
be useful - some involving people and companies, and some involving 
hierarchies of categories, like:

         Animals
            Reptiles
               Snakes
               Lizards
            Mammals
               Dogs
               Cats
            ..etc...

And if it makes a difference, I'm using MySQL.

Thank you,
Nelson Goforth

Reply via email to