View Full Version : Storing properties of a clothing item

08-02-2011, 01:26 PM
I am storing details for clothing items.

Currently each item has a gender, category, type and variation.

E.g item001, male, 4, 6, 3

4, 6 , 3 is a reference to the cats, types and variations table(s).

So 4 is Trousers, 6 is jeans, 3 is slim fit.

However now I want to store much more detail about each item.

So should i use the existing structure and add columns like variation 1, 2, 3 etc or just have one table with all the possible properties and have a itemHasProperties table with item id and property id


Old Pedant
08-02-2011, 08:56 PM
I don't think anybody but you can know the right answer.

But as a general rule, if *most* variations can be attached to multiple *OTHER* variations, then you'd want them in a separate table.

In other words, colors and sizes are clearly independent: each should be a table.

But maybe colors and patterns are closely related; you have red stripes and red checks but never have blue checks. So maybe that means you have a COLORS_AND_PATTERNS table as a single table.

Kind of too general a question for us to answer without seeing the range of variations you are talking about.