A
A
Alexander Rublev2016-10-08 03:28:30
MySQL
Alexander Rublev, 2016-10-08 03:28:30

How to change the required data?

Hello! I apologize for the stupid wording of the question! Couldn't think of a better one.
It's hard to describe the question, so I drew it) I hope you understand!
Briefly: To make a product, you need to perform a certain number of operations at a certain price.
Operations can change and prices for them too! And therefore, it is necessary to somehow remember this information for each ordered product, so that it would be possible to calculate the cost of wages, and so on.
J2blxbas4QkVJr.jpg
So far, I see only one solution to store for each item in each transaction order. As if there are no problems, but for some time the number of lines will be simply huge!
V2VK64gI06gkZA.jpg
I hope you got what I meant! What do you recommend?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
romy4, 2016-10-08
@Meller008

You need to have a product table, an operation table, and a product-operation (1-*) link table, which will also contain the link version and the current price. In this case, the version of the current link will be recorded in the product table. When the link changes, it simply increases by 1 and the set of changed links is entered into the link table. For example, from your scheme there will be such bundles:
t - product, op - operation, v -
version v1.8r) If the price does not change
, then it is simply copied to the new version: back and calculate your cost.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question