Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>May be something like:</p> <p><strong><code>Products</code></strong>:</p> <ul> <li><code>Id</code>.</li> <li><code>Name</code>.</li> </ul> <blockquote> <p>product variations like color and size, colour.</p> </blockquote> <p><strong><code>ProductVariations</code></strong>:</p> <ul> <li><code>Id</code>.</li> <li><code>ProductId</code>.</li> <li><code>StockId</code>(color and size is depending on stock based on the region)</li> <li><code>Colour</code>.</li> <li><code>Size</code></li> </ul> <blockquote> <p>regions have one currency per region and stock per region.</p> </blockquote> <p><strong><code>Currencies</code></strong>:</p> <ul> <li><code>Id</code>.</li> <li><code>Name</code>.</li> </ul> <p><strong><code>Stocks</code></strong>:</p> <ul> <li><code>Id</code>.</li> <li><code>Name</code>.</li> <li><code>RegionId</code>.</li> </ul> <p><strong><code>Regions</code></strong>:</p> <ul> <li><code>Id</code>.</li> <li><code>Name</code>.</li> <li><code>CurrencyId</code>.</li> <li><code>StockId</code>.</li> </ul> <blockquote> <p>product has one price per region</p> <p>product based on region price</p> </blockquote> <p><strong><code>ProductPrices</code></strong>:</p> <ul> <li><code>Id</code>.</li> <li><code>ProductId</code> -> Products table.</li> <li><code>RegionId</code> -> Regions table.</li> <li><code>Price</code>.</li> </ul> <p>You might need to tweak this structure a little bit to accommodate:</p> <ul> <li>The product images depending on whether you need only one image per product or a product can have many images (new table <code>ProductImages</code>).</li> <li>You didn't clarify the product properties you need(product variations) are they a lot of variations for each product (one to many for each product) or its just a properties for each product.</li> </ul> <p><strong>Update:</strong></p> <blockquote> <p>one size can have stock as well.</p> </blockquote> <p>In this case you can move <code>Colour</code> and <code>Size</code> or the <code>size</code> only as you want to a new table, something like, <code>ProductVariationOptions</code>:</p> <p><strong><code>ProductVariationOptions</code></strong>:</p> <ul> <li><code>Id</code>.</li> <li><code>Size</code>.</li> <li><code>Colour</code>.</li> </ul> <p>Then the your <code>ProductVariationOptions</code> would be like this:</p> <p><strong><code>ProductVariations</code></strong>:</p> <ul> <li><code>Id</code>.</li> <li><code>ProductId</code>.</li> <li><code>StockId</code>(color and size is depending on stock based on the region)</li> <li><code>ProductVariationOptionsId</code> -> <code>ProductVariationOptions</code></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload