Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Add allowance to employee table is wrong or true

Author  Topic 

ahmedsa1985
Starting Member

2 Posts

Posted - 2015-02-11 : 13:03:08
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


ahmed salah

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-02-11 : 15:33:57
I'd add a key (maybe an identity value) to the allowance table and a FK from the employee table to the Allowance table.
Go to Top of Page

ahmedsa1985
Starting Member

2 Posts

Posted - 2015-02-12 : 00:11:32
Thank you for reply
you see that the best thing make two tables relation
not add allowance in employee table

ahmed salah
Go to Top of Page
   

- Advertisement -