Relationship between bank tables

0

Hello, I am developing a small order control system for a restaurant and I do not have much experience in database modeling, I have created the following entities:

The problem is the following, for normal products it works but has products that are assembled by materials and I do not know how to merge these materials to each product of each order. I was thinking of ordering each product within the order and adding the materials to order.

An example of an assembled product would be a snack and the customer would choose all of their components, such as bread,

How could I relate these tables in the best way?

    
asked by anonymous 21.06.2017 / 01:18

1 answer

0

According to your snack example the materials of each product varies by product so you could add an id in the Product_Type table and use that id to relate to the Material table, creating another relationship table between both. (table would relate the Material to the Product_has_Pedido - this new table would store the two ids of the Material and Product_has_Pedido table)

    
21.06.2017 / 03:22