From: Martijn Tonies Date: October 19 2004 3:44pm Subject: Re: Ask for help on a mysql problem List-Archive: http://lists.mysql.com/mysql/174475 Message-Id: <045f01c4b5f2$860a46b0$0a02a8c0@martijn> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > > That is ONE way to store a tree structure :-) > > > Another would be: > > > ITEMS > > (ItemID INT AUTO_INCREMENT PRIMARY KEY NOT NULL, > > other stuff) > > > ITEM_PARENT > > (ItemID int, > > ParentID int > > primary key (ItemID, ParentID) > > ) > > > > I prefer the latter. > > The latter is not a tree, but a directed graph. A rooted tree is a special kind of directed graph. Besides, I wonder if you can fully store a graph in these tables (with the PK and all) With regards, Martijn Tonies Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL Server. Upscene Productions http://www.upscene.com