Archive for the ‘Adjacency List’ Category

Models for Hierarchical Data with SQL and PHP

Monday, March 5th, 2012

Models for Hierarchical Data with SQL and PHP by Bill Karwin.

From the description:

Tree-like data relationships are common, but working with trees in SQL usually requires awkward recursive queries. This talk describes alternative solutions in SQL, including:

  • Adjacency List
  • Path Enumeration
  • Nested Sets
  • Closure Table

Code examples will show using these designs in PHP, and offer guidelines for choosing one design over another.

May be of interest as a consumer of data stored using one of these designs or even using them more directly.