List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:October 19 2004 3:44pm
Subject:Re: Ask for help on a mysql problem
View as plain text  
> > 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

Thread
Ask for help on a mysql problemTeng Wang15 Oct
  • Re: Ask for help on a mysql problemDiona Kidd15 Oct
  • Re: Ask for help on a mysql problemEgor Egorov19 Oct
  • Re: Ask for help on a mysql problemMartijn Tonies19 Oct
  • Re: Ask for help on a mysql problemHarald Fuchs19 Oct
  • Re: Ask for help on a mysql problemMartijn Tonies19 Oct
Re: Ask for help on a mysql problemMartijn Tonies19 Oct