Trees and hierarchical data in SQL
From Hashmysql
Here are some links to good articles on trees and hierarchical data in relational databases
Sitepoint article Storing Hierarchical Data in a Database By Gijs Van Tulder
vbmysql.com article Managing Hierarchical Data in MySQL by Mike Hillyer
Mysql.com article Managing Hierarchical Data in MySQL by Mike Hillyer (note: Article no longer available on mysql.com, but on archive.org)
Some Articles by Vadim Tropashko
Trees in SQL: Nested Sets and Materialized Path
Nested intervals tree encoding with continued fractions
he has more on his blog
and a book
Tropashko SQL Design Patterns: The Expert Guide to SQL Programming