How to get a new column without using the update (Please check with the requirment)

write a query to display the current sal and the new sal for all employees

condition
If job = 'MANAGER' and deptno in (10.20) and then newsal has increased by 15% to the current salary.
If work! = 'MANAGER' and deptno in (10.20) and then newsal has increased by 25% to the current salary.

Select ename, sal as old_sal,
-CASE when work = 'MANAGER' and deptno in (10,20) then (sal + (sal * 15) / 100)
When job! = 'MANAGER' and deptno in (10.20) and then (sal + (sal * 25) / 100)
Another Sal
END as new_sal
EMP;

Tags: Database

Similar Questions

  • How to view the line of columns without using the pivot keyword

    Hello
    could someone help me how to display lines in columns without using the keyword pivot and actuall is my scenario, iam having two tables with names and examples of data is shown below

    MIDDLE MINAME TASKID TASKNAME IDENTIFICATION PROJECT

    1 PROJ1 1 AA 100 PR1_TASK1
    1 PROJ1 3 CC PR1_TASK3 102
    1 PROJ1 DD 4 103 PR1_TASK4
    1 PROJ1 EE 5 104 PR1_TASK5
    1 PROJ1 6 105 FF PR1_TASK6
    2 PROJ2 EE 5 114 PR2_TASK1
    2 PROJ2 6 115 FF PR2_TASK2
    2 PROJ2 GG 7 116 PR2_TASK3
    2 PROJ2 HH 8 117 PR2_TASK4
    2 PROJ2 9 118 PR2_TASK5 JJ
    2 PROJ2 KK 10 119 PR2_TASK6
    2 PROJ2 1 AA PR2_TASK7 120


    The output should show the project and County of tasks at a given stage as shown below

    project AA BB CC DD EE FF GG HH JJ KK
    1 2 0 1 5 3 2 0 2 1 0
    2 1 2 0 2 1 0 2 4 3 1


    Thanks in advance,
    VVR
    CREATE TABLE pivot_test (
    ID           NUMBER,
    PROJECT      VARCHAR2(10),
    MID          NUMBER,
    MINAME       VARCHAR2(5),
    TASKID       NUMBER,
    TASKNAME     VARCHAR2(10)
    );
    
    INSERT INTO pivot_test VALUES (1, 'PROJ1', 1,  'AA', 100, 'PR1_TASK1');
    INSERT INTO pivot_test VALUES (1, 'PROJ1', 3,  'CC', 102, 'PR1_TASK3');
    INSERT INTO pivot_test VALUES (1, 'PROJ1', 4,  'DD', 103, 'PR1_TASK4');
    INSERT INTO pivot_test VALUES (1, 'PROJ1', 5,  'EE', 104, 'PR1_TASK5');
    INSERT INTO pivot_test VALUES (1, 'PROJ1', 6,  'FF', 105, 'PR1_TASK6');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 5,  'EE', 114, 'PR2_TASK1');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 6,  'FF', 115, 'PR2_TASK2');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 7,  'GG', 116, 'PR2_TASK3');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 8,  'HH', 117, 'PR2_TASK4');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 9,  'JJ', 118, 'PR2_TASK5');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 10, 'KK', 119, 'PR2_TASK6');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 1,  'AA', 120, 'PR2_TASK7');
    
    SELECT ID as PROJECT,
           SUM(DECODE(miname, 'AA', 1, 0)) AS AA,
           SUM(DECODE(miname, 'BB', 1, 0)) AS BB,
           SUM(DECODE(miname, 'CC', 1, 0)) AS CC,
           SUM(DECODE(miname, 'DD', 1, 0)) AS DD,
           SUM(DECODE(miname, 'EE', 1, 0)) AS EE,
           SUM(DECODE(miname, 'FF', 1, 0)) AS FF,
           SUM(DECODE(miname, 'GG', 1, 0)) AS GG,
           SUM(DECODE(miname, 'HH', 1, 0)) AS HH,
           SUM(DECODE(miname, 'JJ', 1, 0)) AS JJ,
           SUM(DECODE(miname, 'KK', 1, 0)) AS KK
    FROM   pivot_test
    GROUP BY ID;
    
    PROJECT AA BB CC DD EE FF GG HH JJ KK
    ------- -- -- -- -- -- -- -- -- -- --
          1  1  0  1  1  1  1  0  0  0  0
          2  1  0  0  0  1  1  1  1  1  1 
    
  • I have the table of 3 columns A, B, C. I want to store the sum of columns A B in the C column without using the DML statements. Can anyone help please how to do. ?

    I have the table of 3 columns A, B, C. I want to store the sum of columns A B in the C column without using the DML statements. Can anyone help please how to do. ?

    11.1 and especially you have virtual column

    SQL> create table t
      2  (
      3     a number
      4   , b number
      5   , c generated always as (a+b) virtual
      6  );
    
    Table created.
    
    SQL> insert into t (a, b) values (1, 2);
    
    1 row created.
    
    SQL> select * from t;
    
             A          B          C
    ---------- ---------- ----------
             1          2          3
    

    Before that, a front insert - trigger

    SQL> create table t
      2  (
      3     a number
      4   , b number
      5   , c number
      6  );
    
    Table created.
    
    SQL> create or replace trigger t_default before insert on t for each row
      2  begin
      3    :new.c := :new.a+:new.b;
      4  end;
      5  /
    
    Trigger created.
    
    SQL> insert into t (a, b) values (1, 2);
    
    1 row created.
    
    SQL> select * from t;
    
             A          B          C
    ---------- ---------- ----------
             1          2          3
    
  • How can I register my product without using the online process?

    How can I register my product without using the online process?

    He scored finally got.

  • How do Lightroom 4 5 Lightroom without using the creative cloud?

    I have Lightroom 4 and I am interested to upgrade to 5 of Lightroom, but I don't want to use the creative cloud because I can't afford long-term monthly payments. So, how to pass without using the creative cloud? Is it possible to do this through Adobe, or should I buy it elsewhere? Thank you!

    You access this page: products

    and buy the upgrade to LR 5

  • migration of events imovie to new Mac without using the Migration Wizard

    Hello

    I want to do the following:

    Migrate from iMovie events of an old MacBook Pro (10.6.8 Snow Leopard) created using iMovie ' 08

    TO

    (Yosemite 10.10.5) iMac with iMovie 10.1.1

    All events are stored on 3 external drives (Nothing on the internal drive of MBP). Disks have FireWire interfaces, I can't connect them directly to the iMac.

    The destination is another external drive, with Thunderbolt interface. I copied the serious events in 3 separate directories, but not tried opening them with iMovie. Wasn't sure if there was data stored elsewhere (in ~/Library for example) that might be needed; In addition, I didn't know if I could manually merge the 3 separate records events iMovie with the Finder, or need to do somehow with iMovie.

    I manually moved everything some time ago - I haven't used Wizard migration; I didn't have enough disk space attached to the iMac when I moved everything, so I carried on using iMovie on the old MBP.

    I googled and read several articles on the events to an external drive / to new Mac, but none of them totally covers my starting position and desired end result.

    Would appreciate any insight how to go on this issue, and how and where exactly iMovie keeps all the data you need.

    The articles are (among others):

    https://support.Apple.com/en-us/HT202853 "update of projects and events from previous versions of iMovie in iMovie (2014).

    http://help.Apple.com/iMovie/#mov3ac6d42c "copy or move a video in your library of events to an external hard drive.

    https://support.Apple.com/kb/PH2302 "iMovie 11: copy or move video from your library of events to an external hard drive.

    https://support.Apple.com/en-us/HT203049 "move your iMovie for Mac library (2014).

    If your iMovie ' 08 projects contain media from outside the record of events (for example, from iPhoto or iTunes) then we must first using iMovie ' 08 on your old computer to "consolidate" your support so that everything is copied in the events folder.  Details for the iMovie 11 version can be found at: http://help.apple.com/imovie/#mov3ac6c7c9

    I don't have the ' 08 version help files, but I think it will be the same - you can check with your old Mac.

    "Disks have FireWire interfaces, I can't connect them directly to the iMac.

    FireWire adapters Thunderbolt are available for about € 30, which would use these drives on your new Mac.

    In fact, you can copy the project files and events with the viewfinder of an old external drive to the root level of the new new external drive (which should be Apple - formatted), but it is probably best to do from in iMovie ' 08, as described in the help of Apple.   Do 'copy' and not 'move' - this way you always have a backup of the original on the old disks in case of problems.

    I would like to convert the project files and the events of each of the 3 discs one at a time, creating 3 libraries separate iMovie 10.1.1.  You can always rearrange these in iMovie 10 after you have everything updated and verified.  Some people have reported the update of blocking process at any given time, so update in small batches of events and projects is much better than trying to do everything at the same time.

    In fact I would try to first simply copy one (or a small group) project and its events associated with the new external with iMovie ' 08 HD then update to ensure that it will work - from iMovie ' 08 for iMovie 10.1.1 is a big jump.

    Good luck!

    Geoff.

  • How to get a serial number after using the trial?

    I downloaded the demo of Lightroom 4, and I liked it, so I'll buy it.  However, when I click on the button 'buy' on the Launcher, it redirects me to the purchase page and he asks me if I want to download or have a disk shipped to me.  I just want to buy a serial number to activate my copy for good, since I the trial is essentially the version complete but with a time limit.  How can I do this?

    Click on download.  you don't have to install (or even save the download).  Simply use the serial number to activate the trial you already installed.

    remove the unnecessary download.

  • SQL query on how to add a new column to display the result

    Select emp_code, < new column = 0 >
    from employee_table where < < condition > >

    syntax to add the new column?

    Published by: user9027633 on March 4, 2010 02:53

    user9027633 wrote:
    Select emp_code,
    from employee_table where >

    syntax to add the new column?

    Published by: user9027633 on March 4, 2010 02:53

    Want you like this

    selec emp_code, 0 new_column
      from employee_table
    
  • How to sort a random number without using the command by

    Hello

    How must be sorted, 5 random number without the use of order by in PLSQL
    for example.
    amount of ID
    1 2
    2 9
    3 3
    4 5
    5 7

    Edited by: sake1 1-dec-2010 08:16

    I used Altavista and found an example, how is it?

    DECLARE
    
      /* there is no built array in oracle, you must declare
      your own */
      TYPE Numarray IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
    
      /* the array of numbers - using assoc array because I can start
      with zero like traditional arrays */
      Nums Numarray;
    
      n NUMBER := 0;
    
      Temp NUMBER;
    
    BEGIN
    
      /* load up the array, put 20 random values in the array,
      in array indicies 0 to 19 */
      FOR i IN 0 .. 19
    
       LOOP
        Nums(i) :=  Round(Dbms_Random.Value(1, 1000));
      END LOOP;
    
      /* get the array size */
      n :=  Nums.Count();
    
      /* display the unsorted values - loop through the whole array and
      print out the values */
      Dbms_Output.Put_Line('unsorted:');
      FOR i IN Nums.First .. Nums.Last LOOP
        Dbms_Output.Put_Line(Nums(i));
      END LOOP;
    
      /* bubble sort - using two loops, compare each value with the one
      after it
      if the one after the current one is smaller , then
    
      switch their locations in the array, this is just like standard
      bubble sorts
      in other languages. The only real diff is the syntax.
      */
    
      FOR i IN 0 .. n - 1 LOOP
        FOR j IN 0 .. n - (i + 1) - 1 LOOP
    
          IF (Nums(j) > Nums(j + 1)) THEN
            Temp := Nums(j);
            Nums(j) :=  Nums(j + 1);
            Nums(j + 1) :=  Temp;
          END IF;
    
        END LOOP;
      END LOOP;
    
      /* display the values sorted */
      Dbms_Output.Put_Line('sorted');
      FOR i IN Nums.First .. Nums.Last LOOP
        Dbms_Output.Put_Line(Chr(9) || Nums(i));
      END LOOP;
    END;
    /*
    unsorted:
    155
    909
    795
    977
    942
    214
    105
    269
    283
    820
    108
    594
    784
    921
    856
    736
    802
    457
    951
    411
    sorted
         105
         108
         155
         214
         269
         283
         411
         457
         594
         736
         784
         795
         802
         820
         856
         909
         921
         942
         951
         977
    
    */
    

    In the code the first comment is wrong in fact, I think, this one:
    "There is no table built in oracle, you must declare your own."
    I remember there are some types of collection of the system, if I not mix with something, I remember there was a sort of like they were undocumented, so we can say legally that the comment in the code has always been right.

  • How to get code signing keys without filling the field "company"?

    When you use RIM "Sensitive APIs" I am aware that I should get the signature keys and was directed to: https://www.blackberry.com/SignedKeys/

    When you enter information for my keys the field "Company" is required.

    This is why I'm a bit confused (questions below):

    * How the company is associated with these keys?
    * What happens if I change companies after obtaining the keys?
    * Is that my current employer, so I work? (ie: McDonald's, Burger King)
    * What happens if I am a student?
    * Can I create a company just to get the keys?
    * What happens if I put unemployment in the area of the company?
    * What happens if I set the self-employed in the field of the company?

    I have a job with a company (which is a good thing these days), but at home and as a software engineer and passionate about mobile I just began to develop blackberry applications and I wanted access to these very important APIs.

    Thank you.

    Carl

    Put independent Consultant or put your name. RIM expects you to work for a sort of cabinet when filling out the information, but if you're a solo developer so it makes sense to be put your name or a counselor, since you are the company of one of these two.

  • How to get rid of repeat groups using the query? Its my sql script.

    Mr President.

    worm of Oracle's 10g express edition

    I want to get rid of repeating groups and wants to get result like

    1. 1 RAM null 200 222,0
    2. DVD Player 2 25 34.0
    3. 3 HDD 160 GB Satta 40 49.0
    4. 4 LCD 19\ monitor"20 28.0
    5. 5 color 10 18,0 HP printer
    6. 6 keyboard multimedia keyboard 50 69.0
    7. 7 custom mouse mouse 150 248,0

    If my table script is as below

    BEGIN
           
     -- drop tables 
      EXECUTE IMMEDIATE 'DROP TABLE CUSTOMER';   
      EXECUTE IMMEDIATE 'DROP TABLE PRODUCT';   
      EXECUTE IMMEDIATE 'DROP TABLE SUPPLIER';   
      EXECUTE IMMEDIATE 'DROP TABLE PURCHASE';   
      EXECUTE IMMEDIATE 'DROP TABLE PURCHASELINE';   
      EXECUTE IMMEDIATE 'DROP TABLE SALES';   
      EXECUTE IMMEDIATE 'DROP TABLE SALESLINE';
      EXECUTE IMMEDIATE 'DROP TABLE STOCK';
      
    EXCEPTION
      WHEN OTHERS THEN
        DBMS_OUTPUT.PUT_LINE('');
    END;
    /
    
    
    CREATE TABLE CUSTOMER 
    (
      cust_id NUMBER        NOT NULL
    , name VARCHAR2(50)  NOT NULL
    , address VARCHAR2(100) DEFAULT NULL
    , contactno VARCHAR2(20)  DEFAULT NULL
    , CONSTRAINT CUSTOMER_PK PRIMARY KEY 
      (
        cust_id
      )
      ENABLE 
    );  
    
    
    CREATE TABLE PRODUCT 
    (
      prod_id   NUMBER       NOT NULL
    , name   VARCHAR2(50) NOT NULL
    , description VARCHAR2(50) DEFAULT NULL
    , CONSTRAINT PRODUCT_PK PRIMARY KEY 
      (
        prod_id
      )
      ENABLE 
    );  
    CREATE TABLE SUPPLIER 
    (
      suplr_id   NUMBER        NOT NULL
    , name   VARCHAR2(50)  NOT NULL
    , address VARCHAR2(100) DEFAULT NULL
    , contactno VARCHAR2(20)  DEFAULT NULL
    , CONSTRAINT SUPPLIER_PK PRIMARY KEY 
      (
        suplr_id
      )
      ENABLE 
    );  
    
    
    CREATE TABLE PURCHASE (
      pur_id NUMBER NOT NULL
    , pur_date DATE   NOT NULL  
    , suplr_id NUMBER DEFAULT '0'
    , CONSTRAINT PUR_SUPLR_FK FOREIGN KEY 
      (
      suplr_id
      )
      REFERENCES SUPPLIER 
      (
      suplr_id
      )
    , CONSTRAINT PURCHASE_PK PRIMARY KEY 
      (
        pur_id
      )
      ENABLE 
    );  
    
    
    CREATE TABLE PURCHASELINE (
      pur_id NUMBER DEFAULT '0' NOT NULL
    , prod_id NUMBER DEFAULT '0' NOT NULL
    , pur_qty NUMBER DEFAULT '0' NOT NULL
    , unit_pur_price NUMBER DEFAULT '0' NOT NULL
    , CONSTRAINT PUR_LINE_PUR_FK FOREIGN KEY 
      (
      pur_id
      )
      REFERENCES PURCHASE
      (
      pur_id
      )
    , CONSTRAINT PUR_LINE_POD_FK FOREIGN KEY
      (
        prod_id
      )
      REFERENCES PRODUCT
      (
      prod_id
      )
    , CONSTRAINT PUR_LINE_PK PRIMARY KEY 
      (
        pur_id,prod_id
      )
      ENABLE 
    );  
    
    
    CREATE TABLE SALES (
      sal_id NUMBER NOT NULL
    , sal_date DATE   DEFAULT NULL  
    , cust_id NUMBER DEFAULT '0'
    , CONSTRAINT PUR_CUSTR_FK FOREIGN KEY 
      (
      cust_id
      )
      REFERENCES CUSTOMER
      (
      cust_id
      )
    , CONSTRAINT SALES_PK PRIMARY KEY 
      (
        sal_id
      )
      ENABLE 
    );  
    
    
    CREATE TABLE SALESLINE (
      sal_id NUMBER DEFAULT '0' NOT NULL
    , prod_id NUMBER DEFAULT '0' NOT NULL
    , sal_qty NUMBER DEFAULT '0' NOT NULL
    , unit_sal_price NUMBER DEFAULT '0' NOT NULL
    , CONSTRAINT SAL_LINE_SAL_FK FOREIGN KEY 
      (
      sal_id
      )
      REFERENCES SALES
      (
      sal_id
      )
    , CONSTRAINT SAL_LINE_POD_FK FOREIGN KEY
      (
        prod_id
      )
      REFERENCES PRODUCT
      (
      prod_id
      )
    , CONSTRAINT SAL_LINE_PK PRIMARY KEY 
      (
        sal_id,prod_id
      )
      ENABLE 
    ); 
    
    
    CREATE TABLE STOCK (
      prod_id NUMBER NOT NULL
    , prod_qty NUMBER DEFAULT '0' NOT NULL
    , re_ord_level NUMBER DEFAULT '0' NOT NULL
    , CONSTRAINT STOCK_POD_FK FOREIGN KEY
      (
        prod_id
      )
      REFERENCES PRODUCT
      (
      prod_id
      )
    , CONSTRAINT STOCK_PK PRIMARY KEY 
      (
        prod_id
      )
      ENABLE 
    );   
    
    
    
    
    SET DEFINE OFF;
    
    
    -- ***** Populate Tables *****
    
    
    
    
    --CUSTOMER table data
    
    
    INSERT INTO CUSTOMER VALUES(1,'Kamrul Hasan','Moghbazar, Dhaka','0456789123');
    INSERT INTO CUSTOMER VALUES(2,'Rabiul Alam','Motijheel, Dhaka','0567891234');
    INSERT INTO CUSTOMER VALUES(3,'Shahed Hasan','2-G/1,2-2,Mirpur, Dhaka','0678912345');
    
    
    --PRODUCT table data
    
    
    INSERT INTO PRODUCT VALUES(1,'RAM',NULL);
    INSERT INTO PRODUCT VALUES(2,'DVD Drive',NULL);
    INSERT INTO PRODUCT VALUES(3,'HDD','160 GB Satta');
    INSERT INTO PRODUCT VALUES(4,'Monitor','LCD 19\"');
    INSERT INTO PRODUCT VALUES(5,'Printer','HP Color');
    INSERT INTO PRODUCT VALUES(6,'Keyboard','Multimedia Keyborad (Customised)');
    INSERT INTO PRODUCT VALUES(7,'Mouse','Customised Mouse');
    
    
    -- SUPPLIER table data
    
    
    INSERT INTO SUPPLIER VALUES(1,'Salam Enterprise','2-H/1-10, Mirpur, Dhaka, Bangladesh','0123456789');
    INSERT INTO SUPPLIER VALUES(2,'ABC Supplies','Dhanmondi, Dhaka','0234567891');
    INSERT INTO SUPPLIER VALUES(3,'XYZ Company','52 Gabtali, Dhaka','0345678912');
    
    
    
    
    --PURCHASE table data
    
    
    INSERT INTO PURCHASE VALUES(1,TO_DATE('12-12-2007','dd-mm-yyyy'),1);
    INSERT INTO PURCHASE VALUES(2,TO_DATE('13-12-2007','dd-mm-yyyy'),2);
    INSERT INTO PURCHASE VALUES(3,TO_DATE('13-12-2007','dd-mm-yyyy'),1);
    INSERT INTO PURCHASE VALUES(4,TO_DATE('14-12-2007','dd-mm-yyyy'),1);
    INSERT INTO PURCHASE VALUES(5,TO_DATE('15-12-2007','dd-mm-yyyy'),2);
    INSERT INTO PURCHASE VALUES(6,TO_DATE('20-12-2007','dd-mm-yyyy'),3);
    INSERT INTO PURCHASE VALUES(7,TO_DATE('05-01-2007','dd-mm-yyyy'),2);
    INSERT INTO PURCHASE VALUES(8,TO_DATE('06-05-2007','dd-mm-yyyy'),3);
    INSERT INTO PURCHASE VALUES(9,TO_DATE('15-07-2008','dd-mm-yyyy'),1);
       
    
    
    --PURCHASELINE table data
    INSERT INTO PURCHASELINE VALUES(1,1,25,900);
    INSERT INTO PURCHASELINE VALUES(1,2,10,1700);
    INSERT INTO PURCHASELINE VALUES(1,3,10,5000);
    INSERT INTO PURCHASELINE VALUES(1,4,9,5500);
    INSERT INTO PURCHASELINE VALUES(1,7,100,250);
    INSERT INTO PURCHASELINE VALUES(2,3,15,5000);
    INSERT INTO PURCHASELINE VALUES(2,6,20,500);
    INSERT INTO PURCHASELINE VALUES(3,6,25,450);  
    INSERT INTO PURCHASELINE VALUES(4,7,100,200);  
    INSERT INTO PURCHASELINE VALUES(5,5,10,3450);  
    INSERT INTO PURCHASELINE VALUES(5,6,10,180);  
    INSERT INTO PURCHASELINE VALUES(6,1,15,900); 
    
    
    
    
    --SALES table data
    INSERT INTO SALES VALUES(1,TO_DATE('12-12-2007','dd-mm-yyyy'),2); 
    INSERT INTO SALES VALUES(2,TO_DATE('15-12-2007','dd-mm-yyyy'),3);
    INSERT INTO SALES VALUES(3,TO_DATE('20-12-2007','dd-mm-yyyy'),2);
    INSERT INTO SALES VALUES(4,TO_DATE('28-12-2007','dd-mm-yyyy'),3);
    INSERT INTO SALES VALUES(5,TO_DATE('05-01-2008','dd-mm-yyyy'),1);
    INSERT INTO SALES VALUES(6,TO_DATE('12-01-2008','dd-mm-yyyy'),3);
    INSERT INTO SALES VALUES(7,TO_DATE('12-02-2008','dd-mm-yyyy'),1);
    INSERT INTO SALES VALUES(8,TO_DATE('12-02-2008','dd-mm-yyyy'),2);
    INSERT INTO SALES VALUES(9,TO_DATE('12-02-2008','dd-mm-yyyy'),3); 
    
    
    --SALESLINE table data
    INSERT INTO SALESLINE VALUES(1,1,3,1000);
    INSERT INTO SALESLINE VALUES(1,3,1,5500);
    INSERT INTO SALESLINE VALUES(1,4,1,6000); 
    INSERT INTO SALESLINE VALUES(1,6,2,500);  
    INSERT INTO SALESLINE VALUES(1,7,2,200);   
    INSERT INTO SALESLINE VALUES(2,2,2,1900);    
    INSERT INTO SALESLINE VALUES(2,7,2,200);     
    INSERT INTO SALESLINE VALUES(3,4,1,5500);     
    INSERT INTO SALESLINE VALUES(4,2,1,2200);     
    INSERT INTO SALESLINE VALUES(5,6,1,300);      
    INSERT INTO SALESLINE VALUES(5,7,2,250);      
    INSERT INTO SALESLINE VALUES(6,6,1,300);       
    INSERT INTO SALESLINE VALUES(6,7,3,180);        
    INSERT INTO SALESLINE VALUES(7,1,2,1000);         
    INSERT INTO SALESLINE VALUES(7,2,1,1900);          
    INSERT INTO SALESLINE VALUES(7,3,2,5500);           
    INSERT INTO SALESLINE VALUES(8,4,1,5500);            
    INSERT INTO SALESLINE VALUES(8,6,2,300);             
    INSERT INTO SALESLINE VALUES(8,7,1,200);              
    INSERT INTO SALESLINE VALUES(9,1,3,1000);               
    INSERT INTO SALESLINE VALUES(9,3,2,5500);                
    INSERT INTO SALESLINE VALUES(9,5,2,1000);                 
    
    
    --STOCK table data
    INSERT INTO STOCK VALUES(1,200,15);
    INSERT INTO STOCK VALUES(2,25,10);
    INSERT INTO STOCK VALUES(3,40,10); 
    INSERT INTO STOCK VALUES(4,20,10); 
    INSERT INTO STOCK VALUES(5,10,10);  
    INSERT INTO STOCK VALUES(6,50,20);   
    INSERT INTO STOCK VALUES(7,150,20);    
    
    
    
    
    COMMIT;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    Concerning

    I could not figure out how you pulled your expected results, especially the last column. I guess that your problem I have several prod_id table productline / salesline. If a group of prod_id in these table should solve your problem. Something like that

    SQL> select p.prod_id         as product_prod_id
      2       , p.name            as product_name
      3       , p.description     as product_description
      4       , s.prod_qty        as stock_prod_qty
      5       , s.re_ord_level    as stock_re_ord_level
      6       , pl.pur_qty        as purchaseline_pur_qty
      7       , pl.unit_pur_price as purchaseline_unit_pur_price
      8       , sl.sal_qty        as salesline_sal_qty
      9       , sl.unit_sal_price as salesline_unit_sal_price
     10    from product p
     11    join stock s
     12      on p.prod_id = s.prod_id
     13    join (
     14            select prod_id
     15                 , sum(pur_qty) pur_qty
     16                 , sum(unit_pur_price) unit_pur_price
     17              from purchaseline
     18             group
     19                by prod_id
     20         ) pl
     21      on p.prod_id = pl.prod_id
     22    join (
     23            select prod_id
     24                 , sum(sal_qty) sal_qty
     25                 , sum(unit_sal_price) unit_sal_price
     26              from salesline
     27             group
     28                by prod_id
     29         ) sl
     30      on p.prod_id = sl.prod_id
     31   order
     32      by p.prod_id;
    
    PRODUCT_PROD_ID PRODUCT_NAME         PRODUCT_DESCRIPTION                      STOCK_PROD_QTY STOCK_RE_ORD_LEVEL PURCHASELINE_PUR_QTY PURCHASELINE_UNIT_PUR_PRICE SALESLINE_SAL_QTY SALESLINE_UNIT_SAL_PRICE
    --------------- -------------------- ---------------------------------------- -------------- ------------------ -------------------- --------------------------- ----------------- ------------------------
                  1 RAM                                                                      200                 15                   40                        1800                 8                     3000
                  2 DVD Drive                                                                 25                 10                   10                        1700                 4                     6000
                  3 HDD                  160 GB Satta                                         40                 10                   25                       10000                 5                    16500
                  4 Monitor              LCD 19\"                                             20                 10                    9                        5500                 3                    17000
                  5 Printer              HP Color                                             10                 10                   10                        3450                 2                     1000
                  6 Keyboard             Multimedia Keyborad (Customised)                     50                 20                   55                        1130                 6                     1400
                  7 Mouse                Customised Mouse                                    150                 20                  200                         450                10                     1030
    
    7 rows selected.
    
  • Resume the creative cloud to a new Mac without using the Apple cloud

    Just in time, I have the creative on a Mac, cloud but I'm going to buy a MacBook Air soon and I don't know how to settle with the old account.


    See you soon.

    You can download the Setup file of creative cloud using which you can recharge CC apps:

    https://creative.Adobe.com/products/creative-cloud

    or

    https://ccmdls.Adobe.com/AdobeProducts/KCCC/1/OSX10/CreativeCloudInstaller.dmg

    Reference:

    https://helpx.Adobe.com/creative-cloud/help/download-install-app.html

    Once you sign in with your Adobe using who you bought the subscription ID, it will recognize your ID and activate app accordingly.

  • How can I do a countdown without use the effects &gt; text &gt; numbers?

    I know how to make a countdown using Effects > text > numbers, but that is limited to "30 000" the number.

    I need to count backwards from 6,500,000,000.

    Any ideas how to remove that (and especially the separation with commas)?

    I was about to try this tutorial , but it has the same limit of number 30000.

    Perhaps misunderstood that, although...

    You probably, but not in a strictly formalistic sense. This problem is a general limitation in how deals AE 16-bit double whole precision that affects all the effects / values of the controls (see here for another such case). When you are missing the obvious, is that you don't recognize that for the Visual result no matter how the numbers are generated mathematically, which means that nothing prevents you to use these multiple effects and stringing together to create the illusion. People have done this for years. As an alternative, try to use layers of text and expressions as explained here.

    Mylenium

  • How to format Satellite A60 302 without using the CD/DVD drive

    Hello

    I have a laptop SATELLITE A60-302, and I had a problem with cd player. I want to format the computer (WIN XP) and I wanned to ask if I can format the computer not by the cd player but another way as disk on key or something...

    Thanks :)

    Hello
    Your best bet might be trying to use an external CD/DVD drive to install Windows XP (must confirm that your laptop can boot from USB CD/DVD). I would not recommend it otherwise because they are pretty complicated and you will encounter other issues.

    Concerning
    Ben

  • Re: How to get Corel WinDVD without using the recovery disk?

    The update for Corel WinDVD was rather messy and because of this some owners laptop uninstalled to try to install the new software. Now, we ended up with the only possibility of an image recovery, which, in practice, means losing the software.

    Updates for the Bluetooth and wifi are also pretty messy.
    Is isn´t possible to get this software back without using the recovery disk?

    As you probably know recovery image installed on Toshiba laptops is a kind of software that includes the operating system, drivers, tools specific to Toshiba and utilities but also some additional software like antivirus or DVD player application.

    All drivers and Toshiba tools and utilities are available on the Toshiba download page, and if you want to install the version of the OS, you can download each of them.
    This additional software is not available for download. It's a kind of gift on the owner of the laptop because as the new owner, your machine must be ready to employment with full protection and opportunities to use multimedia content.

    If you don't like it, you can remove the system and use your own applications.

    Summary: this software cannot be downloaded separately and if you want to have it again, you must install original image of recovery designed for your machine.

    If you have any other questions do not hesitate to ask.

Maybe you are looking for

  • What TBird personal library file is lost, that now he wants me to create a completely new e-mail... acct directly from scratch.

    Initially... somehow two address books have been removed... confirmed by the user, TBird file library.So I tried a drag and drop of my BACKUP disk, but it seemed that maybe I hit the wrong button... it looked like he wanted to hours, making me think

  • WLAN is missing the MAC address and can not use WiFi

    After an important virus corrupt my system, I got everything running except internet Wifi access. The configfree detects the unit, Wireless 2200BG, which is enabled and the latest driver downloaded from Intel, but he said nothing to the MAC address.

  • Drivers for laptop HP 2000

    Hello I have a HP 2000 on which I just installed Windows 7 Home Premium 64-bit. The wireless and ethernet drivers were not recognized by default, so now I'm in the quest of trying to find the right drivers for it. I tried a bunch of drivers associate

  • Can not download emails

    I have Microsoft Outlook Express 6, and for the last 3 days I have not been able to download my emails. This is the message I get: An unknown error has occurred. Account: 'mail.sasktel.net', server: 'mail.sasktel.net', Protocol: POP3, Port: 110, secu

  • Strange call claiming to be of support technique microsoft

    I just got a phone call pretending to be technical support from microsoft, and he said "your P.C. contains a virus, I called my local law enforcement agency, and then they asked me what info are they asking me for and I said my credit card informatio