Program to calculate SalesAmt of SalesTarget table
There are three tables.
(1) SalesPerson (SPID, Name, Post)
(2) SalesData (TID, SPID, Month, Year, Amount)
(3) SalesTarget (STID, SPID, Year, TargetAmt, SalesAmt)
Write a PL/SQL program to calculate SalesAmt of SalesTarget table.
Note: SPID, TID, STID auto number field.
STID, SPID, Year, TargetAmt fields are already populated.
[B]Question asked by visitor bhumika d patel[/b]
Re: Program to calculate SalesAmt of SalesTarget table
there is no need to write a pl/sql code to calculate this. Even the following query does what needs to be done,
update SalesTarget
set salesamount =
(select sum(Amount)
from SalesData sd
where sd.SPID = SalesTarget.SPID and sd.year = SalesTarget.year
group by sd.SPID, sd.Year)
Re: Program to calculate SalesAmt of SalesTarget table
Please post what/ how you have tried to solve this problem. experts in the forum are here to help you if you face any problem , not do your home work.
Re: Program to calculate SalesAmt of SalesTarget table
[QUOTE=debasisdas;16345]Please post what/ how you have tried to solve this problem. experts in the forum are here to help you if you face any problem , not do your home work.[/QUOTE]
debasis,
don't be harsh on our members. Let them ask whatever technical doubts they have. A question can be easy to u but the same question can be very hard to solve for some one else.
If you don't want to answer such a question just ignore it. There so many novice members like me to answer them.
Don't take this personally. It is a request from me.
Re: Program to calculate SalesAmt of SalesTarget table
What exactly is your question do u want to insert data or get the information from the table