it would be easier if you gave us an example of what exactly you are working on, but here is how i would use something like that.
i'll use an ecommerce site for example.
the engine of the database would have tables:
category, sub_cateogry, products
the products table has the sub_category id in it, and the sub_category has the category id in it.
of course there are more tables in an ecommerce site, but this is the heart of it.