Here's a link to another node about storing trees in SQL: Tree Structure and Db. It has lots of replies which link to articles about trees and sql. (Sorry I can't describe it more specifically -- I bookmarked it a while ago and still haven't gone back to read it.)