Say I have a database of clothing products. In addition to many other fields, the database needs to store ratings (marks out of 10) on different categories for each product.
For example, one category could be 'occasions'. The occasions could be as follows:
Wear to the office Wear to a wedding Wear on a date ... Wear to a funeral
Each product needs to be assigned a score out of 10 for each of these. So one product could have:
Office: 5 Wedding: 7 Date: 10 Funeral: 0
Which would indicate the item is something cheerful, not too understated, not too formal perhaps.
There are a number of categories like this, and these will be used as part of a search algorithm so speed could potentially be an issue. Also I don't want my product table to get huge. This means I'm uneasy about storing this in the product table as each response having it's own column.
Possibly store this way except in a different table with a join? Just looking for a reasonably flexible and elegant solution.
If I haven't been clear please let me know.
P.S Am using MySQL if that makes a difference...
EDIT: I don't think having a category table and a join table with product_id, category_id and score would work very well. You would either have to name each score column (e.g. wedding_score etc) in the join as aliases, or get multiple score columns returned (one for each category).