Give SQL command to find the average annual salary per job in each department

Give SQL command to find the average annual salary per job in each department pls help

with
data as
(select empno,deptno,job,payday,1000 + trunc(500 * abs(dbms_random.normal)) + decode(deptno,10,500,11,200,12,100,0) salary
   from (select 1000 + trunc(dbms_random.value(10,100)) empno,
                10 + floor(dbms_random.value(1,10) / 4) deptno,
                decode(trunc(dbms_random.value(1,10)),1,'A',2,'B',3,'C',4,'D',5,'E',6,'F',7,'G',8,'H',9,'I','?') job
           from dual
         connect by level <= 17
        (select add_months(to_date(to_char(level),'mm'),-12) + 10 payday
           from dual
         connect by level <= 12
select deptno,job,avg(salary) average_salary
  from data
group by deptno,job
order by deptno,job
DEPTNO
JOB
AVERAGE_SALARY
10
B
1812.83333333333333333333333333333333333
10
F
2046.08333333333333333333333333333333333
10
G
1877.45833333333333333333333333333333333
10
I
2081.75
11
C
1456.08333333333333333333333333333333333
11
E
1654.91666666666666666666666666666666667
11
G
1650.5
11
I
1579.33333333333333333333333333333333333
12
A
1580.58333333333333333333333333333333333
12
E
1414.33333333333333333333333333333333333
12
H
1380
12
I
1404.83333333333333333333333333333333333
Regards
Etbin

Similar Messages

  • Sql query to find the balances for a customer account wise.

    Hi,
    Could someone help me with the sql query to find the balances for each customer account wise. This is need to generate the report.
    presently we are using this query, but the output doesnot return the expected result.
    SELECT sum(nvl(ps.acctd_amount_due_remaining,0)) "Balance"
    FROM      ra_cust_trx_line_gl_dist_all gld,
              gl_code_combinations c,
              ar_payment_schedules_all ps,
              RA_CUSTOMER_TRX_ALL rat,
              ra_customers rc
    WHERE      c.CHART_OF_ACCOUNTS_ID = 101
    and gld.code_combination_id = c.code_combination_id
         and rat.CUSTOMER_TRX_ID=gld.CUSTOMER_TRX_ID
         and rat.CUSTOMER_TRX_ID=ps.CUSTOMER_TRX_ID
    and ps.customer_id=rc.customer_id
         and ps.status='OP'
         and ps.gl_date <= :PDATE
         and ps.org_id=:PORGID
         and ps.class in ('GUAR','INV','DM','DEP')
    and c.SEGMENT4=:Account_id
    and ps.customer_id=:Customer_id
    Thanks in advance.
    Kalyan.

    Can someone help us with this.

  • Can anybody provide the SQL query to find the files uploaded in a particular folder?

    Hi All,
    Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
    GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
    Any help is greatly appreciated.
    With best regards,
    Nevin

    Nevin,
    Be great if we could know the version of Portal. For Rel. 1, here's the query
    select id,masterthingid from wwv_things
    where siteid = &site
    and cornerid = &corner
    &site - Content Area id
    &corner - Folder id
    if you don't know the folder id, use
    select id from wwv_corners where siteid = &site
    and name = &folder
    Hope this helps. I have run into this situation before. Usually, the culprits were
    one of the following:
    1. Junk Characters in description of item (caused due to Copy-Paste)
    2. Special Characters in the File name
    Hi All,
    Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
    GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
    Any help is greatly appreciated.
    With best regards,
    Nevin

  • Error in Dimension formula to find the average price

    Hi all,
    I have tried a dimension formula to find the average price of Product.
    if the product is a parent level member then average price should be the average of the list price,other wise it should be the list price itself.
    IIF([PRODUCT].CURRENTMEMBER.PROPERTIES("CALC")="N",[KEYFIGURES].[LISTPRICE],AVG(DESCENDANTS([PRODUCT].CURRENTMEMBER,[KEYFIGURES].[LISTPRICE],LEAVES)))
    While i tried the same i received some strange error , i don know whether its having some dependency on the Customer dimension. since K0030101 is a memebr belonging to CUSTOMER dimension.
    MDX statement error:"Value K0030101 for characteristic /CPMB/U6D7SXT un"
    I'm not sure whether its an error with  the formula i created or any dependancy issue or whether this scenario is possible  using  dimension formulas or not.
    Thanks in advance .
    Anila Mohan

    Hi everyone!
    We are using BPC 7.5 NW SP08 and we've had the same error message while adding a formula to the Account dimension:
    'MDX statement error: "Value 1 for characteristic /CPMB/S9D7Q23 un".
    We then checked in BW for /CPMB/S9D7Q23 and found out that it was the Product dimension.
    The solution for the issue was quite interesting. I had seen in another post that sometimes CALC property was not correctly determined for SP08. The solution proposed was to edit dimension members, clear ParentH1 column, process dimension, re-edit, paste back ParentH1 values and process dimension again. This corrected CALC property problem.
    It also worked for my case. After doing it to Product dimension I tried again to set the formula in Account dimension and it worked!!
    Hope this helps.
    Regards,
    Luigi Laporte

  • Command to find the top unix processes  doing high disk read and writes

    I would like to know 'the unix command to find the top unix processes doing high disk reads or/and writes
    If any one knows the solution please help me?
    -Swamy

    From the oracle side you can obtain OS process id for sessions having some waits for user I/O
    select p.spid, s.sid, s.sql_id
    from v$session s, v$process p
    where s.paddr=p.addr
    and s.sid in
    select sid from v$session_wait
    where wait_class='User I/O'
    );and to see sessions that are currently waiting on user I/O use
    select p.spid, s.sid, s.sql_id
    from v$session s, v$process p
    where s.paddr=p.addr
    and s.sid in
    select sid from v$session_wait
    where wait_class='User I/O'
    and wait_time=0
    );HTH, Peter

  • How to find the average of table row values it should display in next row in libwindow/​CVI

    Hi,
    How to find the average of table row values it should display in next row in libwindow/CVI
    Please let me know the solution.

    There isn't a built-in function to perform calculations on thable cells. What you can do is to retrieve thable cells values and calculate the average by yourself.
    To retrieve a bunch of cells in a single instruction you can use GetTableCellRangeVals: prerequisite for this function to work correctly is that cells are all included in a Rect structure (shortly, a rectangle) and are all of the same data type. See the help for the function for some explanations and the link to an example of its usage. In Cell range parameter you can pass VAL_TABLE_ROW_RANGE (row) macro to retrieve an entire row. See here for details.
    Once you have retrieved cell values in an array, you can pass it to Mean function to calculate the average.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How can I select an area of a picture (larger than one pixel) and find the average RGB values of all the pixels contained inside the area?

    I'm analysing the differences between several different images and I would like to select a large area of each (such as with lasso tool) and find the average RGB value of all of the pixels within the selection area made/

    With the selection you could do a copy paste and use the histogram of the new layer set the histogram source to selected layer.  The eye dropper sample size may also to get the average  of a square area around a point.

  • Finding the average of all the values stored in a two dimentional array

    public int avg(int[][] numbers2){
        int sum = 0;
        float avg = 0;
        for(int r = 0; r < numbers2.length; r++)
          for(int c = 0; c < numbers2[r].length; c++){
              sum += numbers2[r][c];
          }So I have this code that of course finds the sum of all the values stored in the array int[][] numbers. What I am having an issue with is finding the average of the numbers. When I attempt to use:
    avg = sum / numbers2.length; I get the sum / 3 because my array looks like:
    int[][] numbers2 = {{1, 2, 3},
                                {4, 5, 6},
                                {7, 8, 9}
                                          };Any ideas on what I should do or where I could find information on this process?

    2 dimensional arrays have 2 lengths:
    myArray.length and myArray[0].length
    The first one I believe is fixed, the second one may vary from row to row. But if you know that it won't vary, then you can just use the [0] row length.

  • Finding the average between 2 cursors

    Hi. I am using LabVIEW to produce a graph of force against time, and I am using cursors to locate specific points on this graph while the vi is running. I want to find the average force value between selected cursor points (either during or after the run) but I don't know how to do this - can anyone help?

    OK, here's a downconverted version. (I have not tested it in 8.2, hopefully it is still intact. ))
    (It might need a tweak or two, depending on if you want to include or exclude the cursor positions in the mean calculation. Modify as needed)
    Message Edited by altenbach on 11-10-2008 11:55 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    GetCursors82.vi ‏26 KB

  • How do you find the average bitrate for 1080p movies purchased in iTunes?

    Can anyone point me in the direction of how to find the average bitrate for 1080p movies purchased in iTunes?
    For instance, Sherlock Holmes: A Game of Shadows on Bluray has an average bitrate of 18.523 Mbps.
    Thanks in advance!

    Some titles look great from iTunes Store but over the years I have been very aware of distracting banding issues especially in dark/bright areas for example where you'd expect a smooth gery/black gradient but you get discrete bands of greys to black.
    Many people say they don't see it, but I'm very sensitive to it.
    I'm not convinced it's a pure bitrate problem, more to do with the encoding algorithm. Either way it's a clear disincentive to build a library of this content if you see it.
    AC

  • How do you find the average value of all the data between two points on a single channel

    I am tring to calculate the average value of all the data points on a single plot between two seperate points
    I have attahced an illustration.
    Tim
    Solved!
    Go to Solution.
    Attachments:
    plot.jpg ‏173 KB

    Hey smoothdurban,
    I've seen Brad's code, and trust me, it's worth the effort to let him help you get it up and running - it's definitely the most ideal way to solve this problem.  However, as Brad said, there are multiple ways to tackle this - both interactive and programmatic - so in the meantime, I'll take a second to detail one of the interactive and sure-fire ways to find the average of data between two points on a single channel.
    We'll use"Flags."  Set up your VIEW graph exactly as you did on your original screenshot, using Band Cursors to approximate the beginning and ending X-values representing the range you want to examine.  Next:
    1. Click the "Set Flags" button () that is a part of your 2D Axis System.  Note that you can hold down the Shift button if you ever decide you want to do this on more than a single curve at one time.
    2. Select the "Flags: Copy Data Points" button that enables after Flags are set.
    3. This creates new channel(s) in the default (bold) group in the Data Portal that contains only the Flagged data.
    4. Select DIAdem ANALYSIS.
    5. Select Statistics » Descriptive Statistics.
    6. In the Channels input, select the newly created channel containing your Flagged Y-Data.
    7. Ensure that the Arithmetic Mean parameter is set.  You can preview the data and the result in the dialog before pressing OK to execute the calculation. 
    You may have noticed that in the Descriptive Statistics calculation, one of the parameters that you can set is the range of channel rows to operate on - so, if you know the row numbers of your beginning and ending X-values, you could just simply run the Descriptive Statistics calculation and use this parameter to operate on a row subset of your original channel instead of the entire channel.
    Derrick S.
    Product Manager
    NI DIAdem
    National Instruments

  • How to find the number of records per months  in cube

    Hi,
      how to find the number of records per months for my all cubes?
      Can i use the ListCube transaction to find totl number f records per cube monthwise ?
    Jimmy

    Hi,
    Here is a program to generate no of records and list of ODS and Cubes in Active version.Schedule this program in background and create a cube to load this information and schedule to the data from the file generated by the program. Schedule this all per you requirement.
    1.Copy the code into your Z<programname> from Se38.
    2.change the FILENAME in CALL FUNCTION 'GUI_DOWNLOAD' in the program to the location from where you can pick the information to load data to cube(eg Application server).
    3.Save program.
    4.Schedule the program in background as required
    5.Create cube with infoobjects to hold no of records and Infoprovider name
    6.Load this cube based on event after the program job is done.
    Hence you can report on this cube to see no of records in  CUBE or ODS in your box.
    Please find the code below.
    Cheers,
    Kavitha Kamesh.
    types: begin of itabs ,
          tabname type dd02l-tabname,
          end of itabs.
    data: itab type itabs occurs 0 with header line.
    data: counter type i.
    data: begin of itab1 occurs 0,
    tabname type dd02l-tabname,
    counter type i,
    end of itab1.
    DATA: ITABTABNAME TYPE STRING.
    DATA: LENGTH TYPE I.
    DATA: OBJECT(30).
    data: str(6) type c.
    select  tabname from dd02l into table itab where ( tabname LIKE  '/BIC/F%' or tabname LIKE  '/BIC/A%00' )
    and TABCLASS = 'TRANSP' and AS4LOCAL = 'A'.
    loop at itab.
      select count(*) from (itab-tabname) into counter.
      str = itab-tabname.
      if str = '/BIC/F'.
    LENGTH  = STRLEN( ITAB-TABNAME ).
      SHIFT  itab-tabname BY 6 PLACES LEFT.
    ELSEIf  str = '/BIC/A'.
      SHIFT  itab-tabname BY 6 PLACES LEFT.
      LENGTH  = STRLEN( ITAB-TABNAME ).
    LENGTH = LENGTH - 2.
    endif.
      itab1-tabname = itab-tabname(LENGTH).
      append itab1.
      itab1-counter = counter.
      clear itab-tabname.
      clear:  COUNTER.
    endloop.
    *********** itab1
    loop at itab1.
    write:/ itab1-tabname, itab1-counter.
    endloop.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                    =
        FILENAME                        = 'c:records.xls'
        FILETYPE                        = 'ASC'
    *   APPEND                          = ' '
        WRITE_FIELD_SEPARATOR           = ','
    *   HEADER                          = '00'
    *   TRUNC_TRAILING_BLANKS           = ' '
    *   WRITE_LF                        = 'X'
    *   COL_SELECT                      = ' '
    *   COL_SELECT_MASK                 = ' '
    *   DAT_MODE                        = ' '
    *   CONFIRM_OVERWRITE               = ' '
    *   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = ' '
    *   IGNORE_CERR                     = ABAP_TRUE
    *   REPLACEMENT                     = '#'
    *   WRITE_BOM                       = ' '
    *   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    * IMPORTING
    *   FILELENGTH                      =
      TABLES
        DATA_TAB                        = itab1
    *   FIELDNAMES                      =
    * EXCEPTIONS
    *   FILE_WRITE_ERROR                = 1
    *   NO_BATCH                        = 2
    *   GUI_REFUSE_FILETRANSFER         = 3
    *   INVALID_TYPE                    = 4
    *   NO_AUTHORITY                    = 5
    *   UNKNOWN_ERROR                   = 6
    *   HEADER_NOT_ALLOWED              = 7
    *   SEPARATOR_NOT_ALLOWED           = 8
    *   FILESIZE_NOT_ALLOWED            = 9
    *   HEADER_TOO_LONG                 = 10
    *   DP_ERROR_CREATE                 = 11
    *   DP_ERROR_SEND                   = 12
    *   DP_ERROR_WRITE                  = 13
    *   UNKNOWN_DP_ERROR                = 14
    *   ACCESS_DENIED                   = 15
    *   DP_OUT_OF_MEMORY                = 16
    *   DISK_FULL                       = 17
    *   DP_TIMEOUT                      = 18
    *   FILE_NOT_FOUND                  = 19
    *   DATAPROVIDER_EXCEPTION          = 20
    *   CONTROL_FLUSH_ERROR             = 21
    *   OTHERS                          = 22
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • How to find the third highest salary by distinct the salary from deptno20,from employee table

    how to find the third highest salary by distinct the salary from deptno20,by using employee table

    You already asked this question, a half hour earlier:
    https://forums.oracle.com/thread/2569985
    and received a reply.
    Do not multi-post to the forums.
    These are user-to-user forums and everyone is posting because they volunteer to post and not because they get paid to post.    Everyone else is paid exactly the same as you are paid to post here.   When you multi-post is makes you appear as impatient and expecting instantaneous answers.
    That is poor forum etiquette, approaching behavior similar to spamming the forums.
    This duplicate post is locked.

  • How to find the third highest salary from deptno20,from employee table

    how to find the third highest salary from deptno20,from employee table

    SELECT *
      FROM emp;
    EMPNO
    ENAME
    JOB
    MGR
    HIREDATE
    SAL
    COMM
    DEPTNO
    7369
    SMITH
    CLERK
    7902
    12/17/1980
    1000
    3
    20
    7499
    FEDERAL
    SALESMAN
    7654
    2/20/1981
    2000
    4
    30
    7521
    WARD
    SALESMAN
    7698
    2/22/1981
    3000
    4
    30
    7566
    JONES
    MANAGER
    7839
    4/2/1981
    4000
    3
    20
    7839
    MARTIN
    SALESMAN
    7698
    9/28/1981
    5421
    4
    30
    7698
    BLAKE
    MANAGER
    7698
    5/1/1981
    6222
    4
    30
    7782
    CLARK
    MANAGER
    7839
    6/9/1981
    5222
    2
    10
    7788
    SCOTT
    ANALYST
    7566
    12/9/1982
    5463
    3
    20
    7839
    KING
    PRESIDENT
    7902
    11/17/1981
    8543
    2
    10
    7844
    TURNER
    SALESMAN
    7698
    9/8/1981
    2124
    4
    30
    7876
    ADAMS
    CLERK
    7788
    1/12/1983
    2125
    3
    20
    7900
    JAMES
    CLERK
    7698
    12/3/1981
    5462
    4
    30
    7902
    FORD
    ANALYST
    7566
    12/3/1981
    2132
    3
    20
    7934
    MILLER
    CLERK
    7782
    1/23/1982
    5165
    2
    10
    SELECT sal, deptno
      FROM (SELECT   a.*,
                     DENSE_RANK () OVER (PARTITION BY deptno ORDER BY sal DESC) r
                FROM emp a
          ----  ORDER BY sal DESC
    WHERE r = 3;
    SAL
    DEPTNO
    5421
    30
    5165
    10
    2132
    20
    Regards ,
    Friend
    Message was edited by: MostWanted!!!!

  • Is there any command to find the running cloud services in the current PC in windows?

    Is there way to find the list of running cloud service providers in the current PC through C++ programming ?
    Or is there any other tool which gives the list of service providers running in the PC?
    I know this question is not related to Azure but Azure comes under this part..
    Please let me know the answer if any one is aware of it....

    Hello DeekshaBharathi,
    There are only 3 ways of communicating with the Azure cloud services:
    a. Management Portal
    http://azure.microsoft.com/en-us/documentation/articles/cloud-services-how-to-manage/
    b. REST APIs
    http://msdn.microsoft.com/en-us/library/azure/ee460799.aspx
    c. Powershell
    http://msdn.microsoft.com/en-us/library/azure/jj156055.aspx
    Since that you want to use commands to manage Cloud Services. You can do it using PowerShell. You can refer to the article above for more information on this.
    Thanks,
    Syed Irfan Hussain.

Maybe you are looking for

  • Why does my 2014 Mini go to sleep in the middle of activity?

    My 2014 Mac Mini is primarily used as a home theater unit. For display, it's connected via HDMI to a port on my Onkyo home theater receiver, which is in turn connected to my Sony 52" LCD. I have an external Bluray drive connected, as well as a 2TB US

  • Adf-loc.jar? - How to generate in ANT builds

    Hi, I've noticed that when packaging my app through JDeveloper, it automatically generates this "adf-loc.jar" in the correct location. a) What is this Jar? What is it used for? b) How do I generate it through my ANT build script? I've notice that it

  • SAP IDM  7.0 integration with third party system

    Hi Experts, I know SAP IDM  7.0 can integrate with third party systems and create user ids on most of the third party systems. But I need to know regarding If it is possible to integrate with following systems 1) Microsoft Exchange 2007 (  I know til

  • My Motherboard is dead :(

    Hi guys: i need an explanation for this.... i tryed to install a new optical drive on my G4 and when take out the IDE cable (of course the computer was shutdown and disconnected). installed the new one, and now my mac doesn't start up . The dimmer fr

  • What this ?!!! bug in software or what ?

    When i open calls and press hold on any contact this is i see . what this ? Nader A. Samaan