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…

Toggen builds a new website

So I have built and hosted a new website for Roger Clark Pest Management they are a family owned and operated Pest...

WizTree

Just downloaded WizTree (not a sponsor) from https://wiztreefree.com/ It seems to do what it says on the tin which is...

Scam call from “Telstra”

Just had a call from a man with a sub-continental accent from caller ID 0734946596 Told me there was problem with my...