Hello.
I have been working on trying to design a database that is normalized (MySQL) and I'm running into problems.
Currently, the solution I keep ending up with is having 4 ID columns in the final ArticleTBL that contain the ID's of higher category tables. For example -
ArticleTBL
article_id | maincat_id | subcat_id | subsubcat_id | subsubsubcat_id | title |
Each article needs to be associated some way with these categories. I keep thinking that there has to be a better way but for the life of me cannot figure out how.
I would appreciate any suggestions some people might lend. I made a small relationship below and the following list is how information will occur in each:
MainCat - right now I have 3 main categories. I am only showing the relationship of one because the others follow the same pattern. I wish to be able to add more MainCat's when required.
subCat - 4 at the moment. Can't see adding more. 2 only occur in the first MainCat0, the other 2 occur both in MainCat1 and MainCat2.
subsubCat - 6 at the moment. Might need to add more in the future.
subsubsubCat - 20 categories at the moment. Not all are repeated for each subsubCat. Will be adding more in the future.
Title - Multiple and adding more. These are the final products and each is unique, classified by the higher categories.
Thanks for any feedbackCode:MainCatTBL SubTBL SubSubTBL SubSubSubTBL ArticleTBL MainCat0--+--subCat0--+--subsubCat0--+--subsubsubCat0--+--Title0 | | | | | | | +--Title1 | | | | | +--subsubsubCat1--+--Title2 | | | | | +--Title3 | | | +--subsubCat1--+--subsubsubCat0--+--Title4 | | | | | +--Title5 | | | +--subsubsubCat1--+--Title6 | | | +--Title7 | +--subCat1--+--subsubCat0--+--subsubsubCat0--+--Title8 | | | | | +--Title9 | | | +--subsubsubCat1--+--Title10 | | | +--Title11 | +--subsubCat1--+--subsubsubCat0--+--Title12 | | | +--Title13 | +--subsubsubCat1--+--Title14 | +--Title15
Robert



Bookmarks