28.4. Other Models for Trees and Hierarchies

Other models for trees are discussed in a separate book, but these three methods represent the major families of models. You can also use specialized models for specialized trees, such as binary trees. The real point is that you can use SQL for hierarchical structures, but you have to pick the right one for your task. I would classify the choices as:

1.Frequent node changes and infrequent structure changes. Example: organizational charts where personnel come and go, but the organization stays much the same.
2.Infrequent node changes with frequent structure changes. Example: a message board where the e-mails are the nodes that never change, and the structure is simply extended with each new e-mail. ...

Get Joe Celko's SQL for Smarties, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.