slkhlaw Posted November 23, 2005 Share Posted November 23, 2005 I came to a stumble block while trying to design my database. Two problems basically. I hope someone could lend me a hand. 1) I am trying to categorise my stuff into 3 generations of categories (Eg. Main category, Sub category, sub-subcategory). And would like to keep the option open to further sub divide them into 4 generations or more in the future if deemed necessary. My current table looks like this, I don't know how to normalise from here onwards. Table Item Item-ID - PK Title Description Location (Cities, Countries, Continents) SubSubCategory SubCategory MainCategory What eventually I want to have is a main page which list all the maincategory. When user click to look at a particular main category, all the subcategory will be displayed. And when the user click on the subcategory, all the subsubcategory will be displayed. When the user click further, all the items from the same subsubcategory will be displayed. (A bit like Ebay's category) 2) Second problem also related to the above table. Location will be dependent on Cities, Countries and Continents. And all the three are related with one another. A bit like subcategory problem above. What basically I want to achieve here is that when a user would like to search by location, i.e. closest cities to him, or the countries he is in. Or within certain continent (i.e. Europe). Actually I am more comfortable with flat table in this instance, but I can imagine there will be massive amount of duplication. Can someone help me? Quote Link to comment https://forums.phpfreaks.com/topic/2923-normalisation-question/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.