Table1: usermaster
uid uname
1 abc
2 xyz
3 pqr
4 def
Table2: transactionmaster
tid uid amount type
1 1 100 1
2 2 500 1
2 2 500 2
3 1 350 1
3 1 150 2
type in transaction table:
1 for capital
2 for interest(5% of total capital)
Now, I want to calculate the interest
of capital amount and ad interest of capital values 5% every month.
Query should be passed which is : add interest entry in transactionmaster
table automatically for both users who have capital.
Result should like this in transactionmaster
table.
tid uid amount type
1 1 100 1
2 2 500 1
3 1 600 1
4 1 35 2
5 2 25 2
Here interest
also count automatically 5%.