Calculate daily profit from the table of purchases and sales of the MySQL database
Hello world.
There is a Table of MySQL databases with the history of purchases and sales. Calculate daily separately for each product from the history of trade:
- Profit
- number of sales and purchases
- volumes of purchases and sales
- asset balances (unsold) and their average value (the average value is calculated as a result of dividing the total costs by the total number of coins) for each unsold commodity separately!
To solve the problem of calculating daily profit, the most suitable principle of calculation is the LIFO method (LIFO: Last In – First Out). What was bought later is sold first. This method refers to the batch accounting method.
I see two ways to solve the problem:
1. MySQL LIFO (understand and understand the principle)
2. There is an excel file that calculates the profit exactly as it should. It uses both regular formulas and a VBA script. Parse the script, understand how it works and transfer the calculation logic to MySQL.
There are a bunch of pitfalls. Assess your strength. Write - I will throw a more detailed TK, answer questions and ask my questions. Thank you.
06.07.2022 14:52