Question

While designing an online shop database I had a problem with one part, could please someone give me an advise whether it is designed ok? The idea is that there are products which can be assigned to categories. Each category has a set of parameters for an easier search of products by customers. For example, a category "CPU" will have parameters "cpu family", "cpu speed" and category "HDD" will have "form factor" and "spindle speed". These parameter names are stored in the table tbCatParam and values of parameters for each product are in the table tbProdCatParam.

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

Will it work like this? Many thanks

Was it helpful?

Solution

If woul be better if you have no relation between tables TbProdCatParam and TbProdCat, for its recursive. You are relating TbProdCat and TbCategories, wich is related with tbCatParam. Thus, if the tbCategories has parameters, makes no sense you create another NxN relation between tbCatParam and tbProdCat, wich is a NxN table for itself.

This way, you even not need the table tbProdCatParam (unless you need paramCategories in both products and categories, but makes no sense).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top