title: Hierarchical/tree database for directories path in filesystem
body: <p>I want to store the directories (present on the disk) into a database, maintaining their hierarchical/tree structure.</p>
  
  <p>Here's a figure:</p>
  
  <pre>
                           (ROOT)
                         /        \ 
                      Dir2        Dir3
                     /    \           \
                   Dir4   Dir5        Dir6
                   /          
                 Dir7
  </pre>
  
  <p>I am using the <strong>SQLite</strong> database. </p>
  
  <p>Please suggest me:</p>
  
  <ol>
  <li><p>the SQL query to store above structure in SQLite database, and </p></li>
  <li><p>a query to retrieve full path of the directory when I select one.</p>
  
  <p>i.e. suppose I select <code>Dir7</code> then I should get the full path like <code>ROOT/Dir2/Dir4/Dir7</code></p></li>
  </ol>