From: Peter Brawley Date: June 19 2007 5:23pm Subject: Re: Best Database Representation of a Chain of Command List-Archive: http://lists.mysql.com/mysql/207588 Message-Id: <467810FE.8060201@earthlink.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------080506060201010509060600" --------------080506060201010509060600 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit >I'd like to represent our organization's chain of command (i.e. who is whose >boss) in a database. For some ideas see http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch20.html PB David T. Ashley wrote: > I'd like to represent our organization's chain of command (i.e. who is > whose > boss) in a database. > > The reason is that in some contexts, my database application needs to > know > who can view whose time and project records (and the rule is that anyone > above in the chain of command can, anyone at the same level or below > cannot). > > Conceptually, this is of course a tree. > > What is the best representation? > > My notion would be just a single table with a collection of > "boss-subordinate" records. To find person X's boss, query by where X > appears as the subordinate. To find person X's first-level subordinates, > query by where X appears as boss. > > Is there a better way to represent a tree? > > Thanks, Dave. > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.472 / Virus Database: 269.9.1/854 - Release Date: 6/19/2007 1:12 PM > --------------080506060201010509060600--