- Where Developers Learn, Share, & Build Careers
I need to develop a web app that allows companies to predict financials.
The app has various screens, the second to define an employee's salary, for sales projection etc. Originally an app has to turn on the financial forecast model.
The question is, what would be the best way to design a database, so that financial reports (eg a profit and loss statement or balance sheet) could be generated quickly?
- For a prediction period of 5 years, suppose you have a table with 5 years * 12 months = 60 fields in each row? Is this sufficiently demonstrative?
- Do you trigger the DB, whenever any employee data changes, will the recalculation of salary expenditure be made?
I thought storing forecasts of each month in that table on my own line Better it looks like this
Month forecast - --- -------- 30000 2 31000 3 28000 ... ... 60 52000
Then you can use the total work to calculate estimated reports, discounted cash flows etc. (Like you just want to leave United Nations for 4 years):
SELECT SUM (forecast) from FORECASTS where month = & gt; 1 more month & lt; = 48
For salary expenditure, I would think that from the point of calculation on the fly (or if you support the DB engine "physical ideas" then there should be enough performance, as long as That we do not speak a large number of employees or really slow DB.
There is probably a salary history table, which makes the trigger trigger when changing the data S / payroll run
Staff ID Month Salary ---------- ----- ------ 1 1 4000 2 1 3000 3 1 5000 1 2 4100 2 2 3100 3 2 4800 ... ... ...
Again, you get the report data to get SUM or other composite Can work.
Comments
Post a Comment