﻿<?phpxml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<channel>
<title>Common Interview Questions - Can you explain methods of storing tree structure into the DB tables?</title>
<link>http://commoninterview.com/Programming_Interview_Questions/can-you-explain-methods-of-storing-tree-structure-into-the-db-tables/</link>
<description>Another very common variation is how to store a tree data structure in a database.Be prepared to answer this question even if you are applying for U ...</description>
<pubDate>Thu, 15 Jul 2010 23:13:36 MDT</pubDate>
<language>en</language>
<item>
<title>Comment #182</title>
<link>http://commoninterview.com/Programming_Interview_Questions/can-you-explain-methods-of-storing-tree-structure-into-the-db-tables/#c182</link>
<pubDate>Thu, 15 Jul 2010 22:29:21 MDT</pubDate>
<dc:creator>CodeGuru</dc:creator>
<guid isPermaLink='false'>182</guid>
<description><![CDATA[Once I was asked the same question :)

He asked me to return all underneath nodes under a given node.

If you choose adjacent list structure you can also use the recursion of Common Table Expression (CTE) from SQL Server 2005:

msdn.microsoft.com/en-us/library/ms186243.aspx

For nested set structure it is just a select to find out all nodes whose Begin/End values are within Begin/End of given node
<br/>0 Vote(s) ]]></description>
</item>

</channel>
</rss>

