Wednesday, 11 March 2009

Hierarchical data models in SQL

This morning I was trying to find out how to work with hierarchial data (categories and subcategories) in SQL. I read quite a bit of stuff, but the articles I found most useful were:


The Nested Set / Modified Preorder Tree Traversal Model and the Lineage / Path Enumeration Model seem to be the two recommended models.

After lunch I went on Animal for a bit, then did a bit of work on my photo website. I think I will use the Nested Set / Modified Preorder Tree Traversal Model for my hierarchical categories, as the article about it on the mysql website seems quite comprehensive and relatively easy to understand.

A couple of books I should probably read are The MySQL Book and Joe Celko's Trees and Hierarchies in SQL for Smarties.

After dinner I watched 'Fighter In The Wind' with Mac, then did a bit more work on my photo website.

The weather today was overcast in the morning, then sunny and cloudy in the afternoon. Later in the afternoon it became overcast again.

Food
Breakfast: Lemon marmalade toast sandwich; cup o' tea.
Lunch: Farmy cheddar cheese with sweet & crunchy salad sandwich; ½ banana; slice of Madeira cake; cup o' tea.
Dinner: ½ jacket potato; mashed potato with cheese; grated cheese; baked beans; piece of quiche. Pudding was Jamaica Ginger cake with golden syrup and custard. Coffee.

No comments: