Storing hierarchical data in relational databases, such as MySQL, is an age old question. There have been some solutions such as Adjacency Model or, to a certain extent, Entity Relationship Model. Oracle, on the other hand, although being a relational database has a good support for hierarchical data with its connect by clause but with an express edition being somewhat limited, and the price tag for a standard edition is a hefty $5′800 (enterprise going for $47′500), for an average open source developer its not an option.