I have the following database:
Requirements:
-
The values of the kettles and the customers' addresses can be changed as needed.
-
Each week I need to generate a report for this database, which should contain the information according to the moment of the operation.
Problem:
If I modify the value of a kettle, all requests made using this kettle will become useless, reporting something that is not correct, making the total calculated value of the orders already made change (unacceptable). so I should make a choice:
-
allowing the report to be generated in the interval you want:
-
Create other tables, just for the report, where each request saves all duplicate information so there is no total price inconsistency in the report.
-
Do not modify the values, just mark the kettle as 'inactive' and create another one with changed value, the same with the client (removing the phone as the primary key).
-
Duplicate only the fields that change, in the requested item the value of the kettle, and in the request the address and reference point of the client.
-
Do not care about items or address, just place a Total Value field in the order
-
Allowing the report to be generated only from week to week:
-
Generate the report while the requests are made. for example, with each request appending a row to an Excel file for the respective week.
-
Prevent changes from being made, unless it is immediately after you have done the week's report (which is saved in another file, eg Excel worksheet), and no order has yet been made. p>
Any of these options is acceptable for my scenario, I just ask what would be the "most correct" (or if I thought about it totally wrong and generate report is something else), since almost all break standardization, or reason for the database to start.