Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/2923-normalisation-question/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.