I have a database design issue. My project is about products and retailers.
-
Producttable:product_id, product_name, product_description, category_id, quantity_per_unit -
Retailertable:retailer_id, retailer_name, City -
Retailer's Stocktable:retailer_id, product_id, unit_price, availability
The Retailer's Stock table links each product with its seller
And also Category table with category_id,category_name,category_description
Now I want to have different sizes, colour and brands in product. How should I accommodate them in this database? I have included the price in another table then products table because different retailer can sell the same item at different prices.
Your existing database design already meets your stated requirements. Each instance of a combination of size, colour and brand in a product is a row in your
Producttable. This is often called a Stock Keeping Unit (SKU).If you want to have products at a higher level, think of breaking your current
Producttable into two parts, like so:Then amend your
RetailersStocktable to referenceSKUinstead ofProduct.