What’s the most efficient way how to structure a database for an eshop with products with various sizes and colors?
Say I have a product, a T-shirt. For example, what should be the table/column structure if I then needed to display how many red t-shirts in size XXL are left?
Hope you can understand my question.
Thank you.
Tables:
This is with assumption that the T-shirts will have only one color and not the mix of colors :). If you want to associate more colors to a t-shirt, then you may have to introduce another table for one-to-many relationship between tshirt and color with a composite key.