Having just faced this exact scenario, let me pose another question. (I'll post my solution below) Given the tree scenario, which method seems more effective?
1.) A single table consisting of
[code]
|NODE_ID | DATA | PARENT_ID |
[/code]
Where PARENT_ID is a self-join back to a NODE_ID. This obviously as the disadvantage that a given node doesn't know it's children, and therefore to build an entire subtree requires multiple queries (or a select of the majority of the table).
or
2.) Two tables as defined below...
NODES_TABLE
-----------------------
|NODE_ID | DATA |
-----------------------
NODE_CHILDREN
-----------------------------------------------------
| NODE_CHILD_ID | NODE_ID | CHILD_ID
-----------------------------------------------------
In the second scenario there is an entry in the NODE_CHILDREN table for every combination of a parent, and a child. This obviously has the disadvantage or requiring more data to be stored, but can increase speed/efficiency of sub-tree queries based on a given parent.
Given this, I could not decide on which solution was the most efficient in all situations. In several cases I needed the flexibility of the single table, and the ability to "recurse" a child and on up to each of it's subsequent parents. On the other hand in the case of drawing an interface to display the tree, the second solution required far less computation, and less extra data needed to be queried. My solution was, implement both side-by-side. This gave me the flexibility of using which ever method fit the given scenario, and at the cost of only one extra column storing a single ID.