Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Add allowance to employee table is wrong or true according to my case

Add allowance to employee table is wrong or true according to my case

Scheduled Pinned Locked Moved Database
helpquestioncareer
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ahmed_sa
    wrote on last edited by
    #1

    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

    D M 2 Replies Last reply
    0
    • A ahmed_sa

      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

      D Offline
      D Offline
      David Mujica
      wrote on last edited by
      #2

      Some things to consider in your design ... How about a design like this: employee Key Allowance Code Effective_Start_Date Effective_End_Date Allowance Rate This may not be complete, but what it does for you is that it allows for many types of allowance codes to be associated with an employee, each allowance code has an effective date range with an associated rate. This also allows for 2 employee who have the same allowance code to be compensated differently. You would then need another table which translates the Allowance Code to a description. I use a similar approach when dealing with prices, you have the history of the prices over time ... Just a thought. Good luck. :thumbsup:

      1 Reply Last reply
      0
      • A ahmed_sa

        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

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        What David has described is a many to many relationship, an allowance can be used by many employees and an employee can have many allowances. This is the correct data structure for the requirements.

        Never underestimate the power of human stupidity RAH

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups