update of the commission of 6 percent of the employees in each Department, who got less pay

How to upgrade add 6% commission to the salary of the employee in each Department, which received less pay

Vinodh

ora_1978 wrote:

create table emp (number of eno, ename varchar2 (20), number of salary, number of dno);

Insert into emp values(1,'john',1000,10);

Insert into emp values(2,'smith',2000,10);

Insert into emp values(3,'bill',5000,20);

Insert into emp values(4,'mary',6000,20);

Insert into emp values(5,'charles',1500,20);

Insert into emp values(4,'mary',2000,30);

Insert into emp values(4,'patrick',4500,30);

create table dept (number of dno, dname varchar2 (10));

Insert into dept values(10, 'HR');

Insert into dept values(20, 'IT');

Insert into dept values(30, 'ADMIN');

How to add 6% commission to the salary of the employee table in each Department, which received less pay

for example in the emp table for the dno 20 salary charles should get updated at 1500 * 1.6

Vinodh

Assuming that the two last emp records have 6 and 7 of Brian eno (and not 4 as you have your copy and paste error)...

You can identify the records with the minimum in each Department as...

SQL > ed
A written file afiedt.buf

1 Select keep (dense_rank of first order of salary) of the min (eno) as min_eno
2 of t_emp
3 * Group of dno
SQL > /.
MIN_ENO
----------
1
5
6

3 selected lines.

Tags: Database

Similar Questions

  • Helps to find employees in each Department with pay the lowest

    If I use the from employees of a hr schema table. I want to find the last_name, salary and employee department_id for employees with min (salary) for each Department

    EMPLOYEES / / DESC:

    ame                               Null               Type

    --------------                     ------- -                         -----------

    EMPLOYEE_ID NOT NULL NUMBER (6)

    FIRST NAME VARCHAR2 (20)

    LAST_NAME NOT NULL VARCHAR2 (25)

    EMAIL NOT NULL VARCHAR2 (25)

    PHONE_NUMBER VARCHAR2 (20)

    HIRE_DATE NOT NULL DATE

    JOB_ID NOT NULL VARCHAR2 (10)

    SALARY NUMBER (8.2)

    COMMISSION_PCT NUMBER (2.2)

    MANAGER_ID NUMBER (6)

    DEPARTMENT_ID NUMBER 4

    Here's what I used

    Select last_name, salary, department_id from employee

    where wages (select min (salary) of the Group of employees by department_id)

    order by department_id;

    However, it gives me the employees in each Department with a min wage equal to ANY min wage, even from other departments.

    Just please give me a suggestion on this rewrite?

    Hello

    2776946 wrote:

    ... Here's what I used

    Select last_name, salary, department_id from employee

    where wages (select min (salary) of the Group of employees by department_id)

    order by department_id;

    ...

    You have diagnosed the problem exactly!  It is not enough to see if the wage of the employees table corresponds to a salary of the subquery; you need to check if the salary and the department_id both match.  Then change the subquery to return the salary both the department_id and compare the two, like this:

    SELECT name, salary, department_id

    Employees

    WHERE () salary, department_id) )

    SELECT MIN (salary)

    department_id

    Employees

    GROUP BY department_id

    )

    ORDER BY department_id;

    Apart from formatting, parts in Redare the only changes from what you have posted.

  • Update error... I tried to update for the month and each time it fails

    I tried to perform updates for the month and each time it fails.  I get the same error message... Code 646 WIndows has encountered an unknown error.  I did troubleshooting and you are unable to find assistance.  I don't know much about the workings of the computer, but I know that I should be able to perform these updates.  I think I need it too.  I have 9 at this stage that it cannot load.  Help, please!

    I tried to perform updates for the month and each time it fails.  I get the same error message... Code 646 WIndows has encountered an unknown error.  I did troubleshooting and you are unable to find assistance.  I don't know much about the workings of the computer, but I know that I should be able to perform these updates.  I think I need it too.  I have 9 at this stage that it cannot load.  Help, please!

    This link leads to a response from Bobby Mi, moderator.
    Date: July 6, 2010
    http://social.answers.Microsoft.com/forums/en-us/vistawu/thread/18449f60-C149-4EAF-B8E6-a2880cd7232b

    Bobby Mi response will lead to this tutorial from Microsoft Support:
    http://support.Microsoft.com/kb/2258121

    Hope this can help solve your problem.
    For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • Create id, id of the update with the date for each record

    Hello

    Please give me brief idea or document for this concept:

    I need to create id, date, update id, updated for each record inserted or updated in the database (multiple tables).

    (1) how the user id can be obtained?
    (2) is it better if I use views instead of tables for this?
    (3) is it possible for each record?

    Please show me the full scenario. a piece of code can also be useful.

    Thanks in advance.

    http://psoug.org/reference/table_trigger.html

    Concerning
    Biju

  • SQL query to get the employee details for those who have the same salary

    Hi Experts,
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> WITH EMP AS
      2  (
      3  SELECT 1000 EMPNO,100 SAL FROM DUAL UNION ALL
      4  SELECT 1001,90 FROM DUAL UNION ALL
      5  SELECT 1002,80 FROM DUAL UNION ALL
      6  SELECT 1003,90 FROM DUAL UNION ALL
      7  SELECT 1004,100 FROM DUAL UNION ALL
      8  SELECT 1005,20 FROM DUAL UNION ALL
      9  SELECT 1006,10 FROM DUAL
     10  )SELECT * FROM EMP;
    
         EMPNO        SAL
    ---------- ----------
          1000        100
          1001         90
          1002         80
          1003         90
          1004        100
          1005         20
          1006         10
    
    7 rows selected.
    SQL>
    Desired output:
         EMPNO        SAL
    ---------- ----------
          1000        100
          1004        100
          1001         90
          1003         90
    Please suggest how to work on the request?

    Thank you

    Oh, try

    WITH EMP AS
        (
        SELECT 1000 EMPNO,100 SAL FROM DUAL UNION ALL
        SELECT 1001,90 FROM DUAL UNION ALL
        SELECT 1002,80 FROM DUAL UNION ALL
        SELECT 1003,90 FROM DUAL UNION ALL
        SELECT 1004,100 FROM DUAL UNION ALL
        SELECT 1005,20 FROM DUAL UNION ALL
        SELECT 1006,10 FROM DUAL
       )
    SELECT * FROM EMP WHERE SAL IN (
    SELECT SAL FROM (
    SELECT count(sal) OVER (PARTITION BY SAL ORDER BY EMPNO) SAL_CNT, SAL FROM EMP
    )
    WHERE  SAL_CNT >1)
    ORDER BY SAL DESC;
    
    EMPNO     SAL
    1004     100
    1000     100
    1003     90
    1001     90
    4 rows returned in 0.01 seconds
    

    * 009 *.

  • Updates to the synchronization of blackBerry Smartphones

    Maybe it's a bad habit, but I was not to accept the many updates to the Blackberry Desktop Manager wants to load on the phone when I do my syncing to update calendar/address book. Is it recommended to accept all updates all the time with each synchronization?

    On these latest near-attempt to load all the updates, there was also a warning message you need to 'enable your wireless device to continue to send and receive emails and use other services of Blackberry. '. Makes me scared here! What is meant by 'activate my wireless device? Turn it on? make a phone call? Definitely, would not take the risk of suddenly losing capabilities of electronic mail on the thing...

    I am particularly GUN-SHY about this because the last time I tried to update some fatal glitch has occurred and it totally fried my phone. Had to build from scratch as the day back, I got it, the pain in the rear. Don't want that to happen again.

    Any advice from others would be appreciated.

    1. I recommend upgrades because usually there is something known to improve the device.

    However, that said, if your BlackBerry works well and have no problems, there is no need to do so.

    2. ALWAYS do your own backup first of all, by using the Desktop Manager > backup.

    3. the warning device activation is there because on certain BES accounts, a password of the BES Admin activation may be necessary to revisit the BES. If you are a personal user, there is nothing to worry about and you can ignore this.

  • Update of the data block on the table

    Hello

    I have a table that already exists with the data. I got another set of spreadsheet data to update the date on the table. The table name is EMPLOYEE.

    The table structure is like this

    > > EMP_ID, FIRST_NAME, LAST_NAME, ADDRESS, PHONE_NUMBER

    Most of the files is not in the data table ADDRESS or PHONE_NUMBER, worksheet contains the updated information that needs to be updated on the EMPLOYEE table.

    Please suggest me a method to update the data.

    I intend to create a temporary table upload the data in the table. and then update the data using tables. Is this right approach please suggest

    Thank you
    Sudhir

    This means that your UNIQUE_ID is truly UNIQUE...

  • Latency of PE T320 Hyper-V hosts that are set by the BIOS update to the host

    Twice now, I got the prompt Exchange 2010 on my W2K8 Standard Server with Hyper-V suddenly suffer a massive amount of latency and become virtually locked out of the blue.  After hours of troubleshooting, restart and research - as a last-ditch effort I noticed that the BIOS is outdated.  I update of the BIOS and then as magically everything works again.

    Anywhere from 2 to 4 months to go and rinse & repeat.

    I'm going out on a limb here, but I suspect that there is something about the system that gets flushed out during an update of the bios that is the cause of the problem, but I am at a loss to determine what is.  I want to avoid proactively with the server my client Exchange fail, but it goes against my better judgment to apply updates BIOS proactively.  We had the motherboard already toggled because of a bad DRAC, and the problem continues to be.

    I could use help to identify what I can do to prevent this from happening in the future.  TIA

    Well we have not seen the question back at all since we changed the system of "Performance per Watt" profile to 'Performance '.  I would start there first.  It is three months and none of our T320 do more.  We are sure, it's the 90 percent solution.

  • After 2015 CC Illustrator update all the floating palettes and bar 19.2.0 invisible data tools

    I've just updated Illustrator CC to 19.2.0 on my MacBook Pro under OS X Yosemite 10.10.5 and all my boxes floating palettes/menu and the toolbar data are all empty boxes are transparent, allowing me to see the desktop behind them by about 50 percent. Also, all dialog boxes to save a document or Illustrator preferences, etc. all open totally empty, so I can't make adjustments to what it is. I've deleted preferences, restarted, Illustrator uninstalled and reinstalled, uninstalled and reinstalled Adobe CC, rebooted about 17 times more and no change at all. I can spend the workspaces and this doesn't change anything, either, nor is check or uncheck Application frame. I can't find anything in the forums to help me. This is ridiculous and I can't work, Please HELP.

    As for the vacuum cleaner, you may consider to ask more questions here:

    Adobe Creative Cloud

    Please also post a screenshot of the interface.

    Astute graphics plugins are updated to the latest version?

    They must be compatible with Illustrator CC 2015.2 and El Capitan.

  • Canon MG7100 prints but will not scan after update of the iMac? How to fix?

    Canon MG7100 worked very well with the iMac - scanning and printing. After doing the updates of the iMac and installation Siri scanning does not work. Always printing. The printer/scanner Canon said - Set PC to start scanning - I have MG7100 added on the iMac. I opened (and re-locked) firewall to let in the Canon UJ utility. I deleted the all-in-one Hi - and added MG7100.

    http://support-Asia.Canon-Asia.com/contents/Asia/en/0100535401.html

    doesn't look like canon has a printer that takes in charge the newer versions of Mac OS x, if I were you I would take contact them to see if they plan on support of new versions, apple made no drivers for the hardware they don't and if hardware manufacturers does not provide a working driver head can group with the new version of Mac OS x We have to rely on manufacturing to have a download on their page

  • The closed display mode is no longer works after update of the Sierra on my MBPro. Known bug?

    I use a vertical dock for awhile, so my MBPro retina works in closed with external display, KB and mouse display mode.

    But since I installed the update of the Sierra, the external display not Mac OS desktop.

    It only works when I open the built-in screen...

    The bug is known? Or y at - it a setting to adjust on the Sierra?

    Thank you in advance

    Hi darklemon,

    I understand that, since the update to Mac OS Sierra, you've been unable to use your MacBook Pro in closed view. I know it's important to use your computer in a way that suits you, then I'm happy to help you.

    Let's start by resetting your memory NVRAM and SMC which can often help with system display and related issues:

    How to reset the NVRAM on your Mac - Apple Support
    Reset the management system (SCM) controller on your Mac - Apple Support

    Once you have done this, follow the steps here to set up the closed display mode:

    Use your Mac laptop to view closed with an external display - Apple Support

    Thank you for using communities Support from Apple. See you soon!

  • Update of the bad experience of typing after Sierra

    After the update of the Sierra the typing experience is sub par.  He lags on the screen and sometimes the AutoCorrect intervenes before you finish typing, "correcting" the word after that I typed it correctly.  It sorts of predicted what I'm typing and corrects until I finished typing so that the end result is something like "unbelievablele" or "correcteded."

    Anyone with the same problem?

    You can disable the automatic correction of spelling and grammar until you are done typing and then allow him to do these things on your work completed. What you have described is Pages doing all this while you type. On the Edit menu.

    Uncheck all the features in the submenu, as I've shown here:

    When you are finished typing, then display spelling and grammar.

  • cannot select the disk to install the update of the Sierra (Macbook Pro 13 inch, late 2011)

    I downloaded the update of the Sierra and proceeded with the installation. However, I noticed that even if I could move the pointer autour, I couldn't make selections on tapping the trackpad. I managed to get past the first steps by using the 'tab' key (keyboard) to make selections and 'space' to make the confirmations. However, arriving at step 'select the disk where you want to install Mac OS', the 'Tab' and 'Space' technical has stopped working. Now I'm stuck here. Can someone tell me please how to go beyond this?

    Looks like it's a problem of trackpad? Or in any case a trackpad issue connected with installation of Sierra? I would take the MBP for a Genius Bar...

  • Time Machine does not work after update of the Sierra

    The time function machine my Mackbook Air 2011 stopped working... it has not been saved since update for Sierra, it only take screenshots every hour, it will perform a backup is no longer on my external HD as before.

    There is no problem with the way it is implemented or the hard drive, it's me that my iMac is working perfectly since the update for Sierra and it's backup via the time machine on the same hard disk.

    It is a hard drive and put in place I was in use for about 5 years with no problems.

    Also since the update for Sierra I noticed that my MacBook Air gets hot and the fans go wild, although there was nothing or performance other than the system is auto.

    I lost the use of my built in camera after the update to El Capitan, and now I've lost the use of time machine... I was wondering if I should go back to Yosemite that everything worked well then!... is this possible?

    Thanks for any help with this!

    Update:-just so you know, time machine is to find the back up ok drive (external hard drive), it then goes to "preparing backup" and that's all, he remains in this preparation save the scene for centuries, after a while it just stops and it is saved all... nothing!

    Also noticed when I checked in Time Machine full backup I have before update for Sierra disappeared, he disappeared, been deleted... I don't know what is happening with it!

    Overall since the update for Sierra my MacBook Air did not work properly, in addition to all that Safari does not load, just to get the wheel spinning, and now (with the demise of my old back ups) it seems I can't go back to a previous state.

    My Mackbook Air took it!... the last update took the camera and really Sierra in... material not compatible with all new software, none of the new features work on my iMac or MacBook Air (only Siri), so a useless upgrade for me really, wish I didn't!

  • Some problems of AppStore after update of the Sierra

    Hi, after update my Mac to Sierra, there are a few problems of the AppStore:

    1. The Pages app updated to v6 and numbers to v4, Keynote, but fails to Update v5 (iWork ' 09)
    2. I've been on the program of public beta for Sierra but have now updated to the release version, but the app store is still trying to download the last Beta of Sierra. I disconnected (e) into the beta program website
    3. The AppStore download iPhoto but the app shows the icon of the incompatible (white circle with bar diagonally) in the Application folder - how to uninstall it?
    4. Is does not work available on the AppStore - the previous Terminal command Debug menu for access to this

    Thank you

    Hello

    Safe Mode boot removes the system caches that can you help an update or upgrade.

    Follow these steps to start in safe mode.

    1. Start or restart your Mac.
    2. As soon as you hear the startup tone, hold down the SHIFT key.
    3. Release the SHIFT key when you see the logo Apple appears on the screen.

    After the Apple logo appears, this may take longer than usual to reach the login screen or your office. This is because your Mac performs a check of directory of your drive to boot in safe mode.

    To leave safe mode, restart your computer without pressing any keys during startup.

Maybe you are looking for

  • Utility HP crashes

    My printer, all-in-one Officejet 6600, prints and copies.  But to analyze, I need to analyze in the HP utility.  However, the utility can not connect to the printer; hang it up at this time.  I uninstalled the printer driver and reinstalled twice, an

  • How many times can I install an App?

    Hello I'm new to the Mac App Store. I bought an App. How many times can I install this application on different devices (MacBook, iMac,...)?

  • field 4 elements on a 3-d chart

    Hi, I'm tracing a 3-d chart with the values of intensity for each defined point (or area if need be) so has every point (x, y, z, i) values. someone said on the thread of the anther that this exsisits already in the plot 3d under the table of 'w', al

  • 8.0.0.561 - The specified Module could not be found.

    I have a Toshiba laptop with Windows 7 Home.  For the last nine months, whenever I have start or open after a "sleep mode", I get a message that I would like to know what it is and a way to correct and eliminate the problem.    The message is this: C

  • Where are the backup of files from a backup Iphone 3 G slot on a computer?

    I looked in the Apple site and I followed the steps and they aren't there. I have windows 7 also. I talked to Apple and they had me go through the control panel and check a box to view all the hidden files and folders. Then they had me go through com