I guess I should start first by explaining what the system actually does to get a better understanding.
The system is a payslip viewer website wherein the uploader(hr personnel) uploads a bunch of payslips in excel format and those entries get saved into the database. The payslip viewer then fetches the emp_id
of the currently logged in user and displays all their earnings, deductions, info
AND their total earnings(all earnings are added), total deductions(all deductions are added) and netpay(total earning-total deduction)
.
My problem is that my professor said I need to "normalize" the table but I was left wondering how could I possibly normalize this as I think this is as "normalized" as it gets. However, I did try to create two erds but I have a couple of questions:
- Why would I split earnings and deductions when the point of the system is just to read what the uploader gives?
- My professor suggested I get the deductions that are same for all of the employees but there is no such thing, the closest one I could think of is the insurance which is also changing depending on the dependencies and other factors that influence it.
- If I did try to create no.3 a problem would be in the event of a change in rates (i.e. Insurance 1 from February = $100 became $200 in March). Since the payslip viewer relies on that table, it would mean if a user would look at his payslip for the month of February, his insurance will also be $200.
- I'm creating this database to comply with the requirement of the system which is for the uploader to upload a spreadsheet of payslips, isn't that enough reason to justify my erd? Maybe if this was a payroll system I could set up other tables than can influence the output of the payslip BUT based on the system, the outputs are already done and the hr just needs to upload them to the database.
My first ERD:
My second ERD:
(I did this to try and normalize it but for the system's requirement, I don't think this is appropriate)