title: Clarification about COMMIT and ROLLBACK in IF statement
body: <p>I have to do this exercise: 
  Decrease the price by 10% with the description "Pay TV"  and COMMIT the changes if the sum of the price with the description "Pay TV" and "minibar" are > 100000.</p>
  
  <p>I'd like to know if with my solution, in the case of a false condition, every change will be ROLLBACK. I'm not sure how COMMIT and ROLLBACK works.</p>
  
  <p>This is my solution</p>
  
  <pre><code>--SPESE_EXTRA (cod, description, price)
  
  DECLARE 
  CURSOR C IS
  SELECT *
  FROM SPESE_EXTRA;
  
  RECORD_C C%ROWTYPE;
  
  SOMMA INT;
  
  BEGIN 
  
  OPEN C;
  LOOP
  FETCH C INTO RECORD_C;
  EXIT WHEN C%NOTFOUND;
  RECORD_C.PRICE := RECORD_C.PRICE *0.9;
  UPDATE SPESE_EXTRA
  SET ROW = RECORD_C;
  WHERE COD = RECORD_C.COD;
  END LOOP;
  CLOSE C;
  
  SELECT SUM(price) INTO SOMMA
  FROM SPESE_EXTRA
  WHERE DESCRIPTION = 'Pay TV' OR DESCRIPTION = 'mini bar';
  
  IF SOMMA &gt; 100000 THEN
  COMMIT;
  ELSE
  ROLLBACK;
  
  end;
  </code></pre>