MostusersatonetimeoranotherhavedealtwithhierarchicaldatainaSQLdatabaseandnodoubtlearnedthatthemanagementofhierarchicaldataisnotwhatarelationaldatabaseisintendedfor.Thetablesofarelationaldatabasearenothierarchical(likeXML),butaresimplyaflatlist.Hierarchicaldatahasaparent-childrelationshipthatisnotnaturallyrepresentedinarelationaldatabasetable.Forourpurposes,hierarchicaldataisacollectionofdatawhereeachitemhasasingleparentandzeroormorechildren(withtheexceptionoftherootitem,whichhasnoparent).Hierarchicaldatacanbefoundinavarietyofdatabaseapplications,includingforumandmailinglistthreads,businessorganizationcharts,contentmanagementcategories,andproductcategories.Inahierarchicaldatamodel,dataisorganizedintoatree-likestructure.Thetreestructureallowsrepeatinginformationusingparent/childrelationships.Foranexplanationofthetreedatastructure,seehere[http://en.wikipedia.org/wiki/Tree_data_structure" >http://en.wikipedia.org/wiki/Tree_data_structure]There are three major approaches to managing tree structures in relational databases, these are:
These are explained in more detail in the following chapters, or see[http://www.dbazine.com/oracle/or-articles/tropashko4 http://www.dbazine.com/oracle/or-articles/tropashko4], [http://dev.mysql.com/tech-resources/articles/hierarchical-data.html http://dev.mysql.com/tech-resources/articles/hierarchical-data.html]