I've got a simple database of products.
Each product is N:1 related to several attributes, such as material, gender, shape and so on.
Each attribute is a table (e.g. table "shapes" with square, round and other rows)
Now I'd like to "translate" each attribute, for example, I want the "square" record, to be associated with "quadrato" (it), "carré" (fr) and so on. "languages" is another table (it,fr,en) and languages can be added or removed, so having columns "it_value", "fr_value" is obviously impossible and ugly.
I'm thinking about
- create a table "TRANSLATIONS" with id, language_id and value
- create a table "LANGUAGES" with id, name
- create tables "SHAPES" and "MATERIALS" with id and other columns
- create a table (for example) "MATERIAL_TRANSLATIONS" with translation_id and material_id
- create a table "SHAPE_TRANSLATIONS" with the same idea, as above
Do you think other solutions could be more efficient or more elegant than that?
(Sorry for not posting an ER diagram too, but I'm not a so 'graphic' person! ;))