Add allowance to employee table is wrong or true

  • Hi guys I have problem i need to make erd relation entity

    between employee and allowance

    Employee table

    Name

    address

    Basic Salary

    Bonus

    Allowance table

    House rent

    Food Allowance

    Moving Allowance

    Basic Salary is monthly and fixed

    Bonus is monthly and fixed

    food allowance is monthly and fixed for married employee

    House rent is monthly and fixed for some employee and some employee take house rent two time in year every 6 month

    every employee married take 3 months salary from basic salary in year

    suppose i m married and i take basic salary 5000

    i will take rent 5000 x 3=15000/12=1250 monthly

    some employee take rent every half year meaning every 6 month

    meaning 15000/2=7500

    My question according to my case above

    Which is best put allowance in table allowance or put allowance(food,housing,moving)

    in employee table and what relation between two tables

  • Can any one help me if possible

  • Use a separate table as those are different entities.

    You should have an entity allowance with attributes type and amount. You might need to have dates to define time periods but that is something you don't mention how would you handle that.

    How will you manage history?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Thank you for reply

    what you mean with manage history

  • Fully agree with Luis on this one, you need at least another table, but you do need to record history.

    Think of questions like; does the allowance change annually, how is it calculated, is it connected to salary, how do you record any increase as a result of promotion so that you can calculate the full allowance paid in any one period or over successive periods.

    ...

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply