T
T
Torento203452021-04-11 16:31:24
Database design
Torento20345, 2021-04-11 16:31:24

How does the database make it possible to separate a product by color and size in stock?

Tell me how they make a database for stores.
We have a table of products.
How can we make a choice of color and size for each product?
It under each product one more table needs to be created?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Gornostaev, 2021-04-11
@sergey-gornostaev

EAV or jsonb type field for characteristics.

H
hint000, 2021-04-11
@hint000

It under each product one more table needs to be created?
No, the key is not a product, the key is a SKU.
https://ru.wikipedia.org/wiki/SKU

S
SagePtr, 2021-04-11
@SagePtr

The easiest way is to store each type of product as a separate product. prices depending on the size may also differ, and the availability in the warehouse is also different for each modification. Just when displaying the range, group the variations into one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question