title: how does magento store relationship between store and root category in database
body: <p>FYI this is Magento 1.4 which might possibly change things but I'm fairly certain the answer is no.</p>
  
  <p>We have thousands of stores in our Magento site, each representing a school.  Each store is supposed to have a Root Category assigned.</p>
  
  <p>My question is simple, where in the db tables is this relationship stored?  I would like to search for stores by root category, and programmatically (or better yet by db query also) update this information.  Thanks!</p>