I am creating a database using MySQL 5 for an e-commerce website. I want the database as flexible as possible so that website owners can add custom attributes for different types of products. For example, they may have a product that has 4 shirt sizes and 3 colors for each size available, or a product that has 6 shirt sizes, 4 colors for each size, and possibly a 3rd attribute.
The problem I am facing is that they should be able to control the quantity for the product based on its various attributes, and not the product itself. A company may have a product that has 25 pieces in one style and color, but has 13 in a warehouse of a different size and color combination.
Is there a good solution on how to structure this in a MySQL database? Currently, I have a table in which the product identifier will be stored, the number and attributes will be combined in 1 field using the "key: value" syntax, separated by a comma.
This is my first time trying to create such a system. Any information / help would be greatly appreciated. If you need more information, I can also provide this.
Hey guys, I really appreciate the recommendation. But for this Derived Item method, would I need to create a different database table for each type of product, since the products could have variable attributes associated with them?
source
share