Database Design for Online Ordering System

When developing an online store database, I had a problem with one part, can someone give me advice, is it designed correctly? The idea is that there are products that can be assigned to categories. Each category has a set of parameters for easier customer search for products. For example, the category "CPU" will have the parameters "processor family", "processor speed" and the category "HDD" will have a "form factor" and "spindle speed." These parameter names are stored in the tbCatParam table, and the parameter values ​​for each product are listed in the tbProdCatParam table.

My schema is available here as jpeg: http://cid-ce0a6f63806e1ea9.office.live.com/self.aspx/PuclicFolder/scheme.jpg

Will it work like this? Thank you very much

+4
source share
1 answer

If woul will be better if you have no relation between TbProdCatParam and TbProdCat tables, for its recursive. You bind TbProdCat and TbCategories, which are associated with tbCatParam. Thus, if tbCategories has parameters, it makes no sense to create another NxN relationship between tbCatParam and tbProdCat, which is the NxN table for itself.

That way, you don’t even need the tbProdCatParam table (unless you need paramCategories in both products and categories, but it makes no sense).

+2
source

Source: https://habr.com/ru/post/1340107/


All Articles