0

hey!
i need to create a customised table "Employee" in which i have to insert employeeid,employeename and salary...on inserting the salary,the table should automatically calculate Hra(10% of basic salary),DA(9% of basic salary) and hence calculate net salary...so...plz guide me...how to do this?

3
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by smantscheff
0

how to do this

Don't. Do not store calculated values in your database. If Hra and DA are percentages of another database field, create a view which calculates them instead of storing them.

0

but how can i calculate values in a view???
can u plz show me thru some example...plz...i need to complete this by today otherwise my teacher will screw me...plz guide me

0

You need to crate a view and add the calculated values as columns.

HRA = salary * 10/100
DA = salary * 9 /100
net = HRA + DA

Edited by debasisdas: n/a

-1

i still didnt get u...need an example...plz read my above query carefully

Votes + Comments
you need to read carefully, don't expext to be spoon feed here.
0
create view xyz as 
select *, salary * 10 / 100 as HRA, salary * 9/100 as DA, salary * 19/100 as net from employees
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.