I am trying to make a relational database that can support as many catagories and subcatagories and sub sub cats, etc as possible. What I mean is something that can emulate a directory structure (Ie as many folders in folders as possible) using very few tables as possible.
What I did is create a table in Access with 3 fields. CatID, CatName, and SuperCat. SuperCat is related back to CatID, but is not required. It SEEMS like it works, but I haven’t tried any SQL queries yet, but I’m sure the query will be very complicated.
Is there a better, more robust and “safer” way to make this DB? How would you do make this? If anyone knows and likes SQL, please feel free to make the query for my table or any people post.
You’ve got the idea. What you need is a recursive table, as you laid out. The only thing that I can add to this is to place a restriction on the SuperCat column that the values placed in it must be present in the CatID column.
Zev- The problem with placing the restriction on the SuperCat colum is that the highest level Cats would need to point somewhere. How do I get over this?