Re: [Phplib-users] OT: Database Design Help
Brought to you by:
nhruby,
richardarcher
From: Manuel A. <mpa...@so...> - 2001-11-07 20:09:18
|
At 06:03 07/11/01 -0800, you wrote: >I'm setting up a database with the following parameters: > 2500 products > 11 main categories > 88 subcategories >Each subcategory belongs to a single category, and each product belongs to= =20 >several subcategories ... I'd try this: product: product_id + category_id + product_whatever_1 + ... +=20 product_whatever_n category: category_id + category_whatever_1 + ... + category_whatever_n subcategory: subcategory_id + category_id + ... product_subcategory_assoc: product_id + subcategory_id to search by attributes of a product: search in product table to search by category: same as above to search by subcategory: search in product_subcategory_assoc being the number of categories and subcategories rather small, perhaps you= =20 could hardcode the table somewhere in your code, but i don't know if they=20 need to be updated. in addition, you can implement the product_subcategory_assoc association as= =20 a "belongs_to" column in the product table of type SET. But i wouldn't do=20 that if the number of subcats a product belongs to is big. Manuel Aristar=E1n Bah=EDa Blanca, Argentina mpa...@so... |