1
I am with a project to create an e-commerce, in which my doubt refers to the modeling of tables:
Category(ROOT)>sub-categories>sub-categories of sub-category.
As should be these tables, and a product may be within categories pharisaic (root), and in them may also be in sub-categories. The tables would have to be able to work the same as the print below, follows:
would say the same thing :)
– Marco Souza
Roberto, I edited my question and added another image, being it reference of your example, would be this?
– Gabriel Filippi
In my view you don’t even need this table
categorias_has_produtos
. The fieldCategorias_id
can be directly on the tableProdutos
. That’s because, the category and product ratio is1-1
, if it were1-N
ai yes this third table would be necessary.– Roberto de Campos
but this is the case, the product may be in more than one category at the same time, hence it would be necessary to table categorias_has_products, correct?
– Gabriel Filippi
Ah yes, so it is necessary yes this third table.
– Roberto de Campos
@Robertofagundes, thank you for your help!
– Gabriel Filippi