Results 1 to 5 of 5

Thread: Program to calculate SalesAmt of SalesTarget table

  1. #1
    Geek_Guest
    Guest

    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.

    Question asked by visitor bhumika d patel


  2. #2
    Expert Member
    Join Date
    Jun 2006
    Answers
    410

    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)


  3. #3
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    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.


  4. #4
    Expert Member
    Join Date
    Jun 2006
    Answers
    410

    Re: Program to calculate SalesAmt of SalesTarget table

    Quote Originally Posted by debasisdas View Post
    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.
    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.


  5. #5
    Junior Member
    Join Date
    Jun 2007
    Answers
    18

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact