Using Databases to Store Hierarchical Data

Written by James McDonald

March 28, 2011

Databases or more correctly how Databases model things in the real world fascinate me.

Reading up on the CakePHP Tree Behavior I found a link to Managing Hierarchical Data in MySQL

A really good primer on why database tables use a single table to represent Hierarchical Data.

The two examples that that come to my mind are a Bill of Lading and a Recipe or Formula:

e.g.
Bill of Lading is a parent, The items on the bill of lading are children
A Formula or Recipe is the parent, The ingredients are children, which in turn can have children of their own.

The Managing Hierarchical Data in MySQL article linked to above helps to get your head around how to structure the data sensibly in a database.

I give it 5 stars Dave.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

You May Also Like…

How to Research a CPU Upgrade

How to Research a CPU Upgrade

Upgrade Time! Doing a lot of VMWare Workstation virtualization to create labs for self-study and training. Finding...