Oracle PL/SQL - What is the output: with or without Parentheses?

Question

What is the output of the following code?

DECLARE 
  salary      NUMBER := 60000; 
  commission  NUMBER := 0.10; 
BEGIN 


DBMS_OUTPUT.PUT_LINE('(salary * 0.05) + (commission * 0.25) = ' 
  || TO_CHAR((salary * 0.05) + (commission * 0.25)) 
);                
                  
DBMS_OUTPUT.PUT_LINE('salary * 0.05 + commission * 0.25 = ' 
  || TO_CHAR(salary * 0.05 + commission * 0.25) 
);                
END; 
/ 

Note

Parentheses, even when unnecessary, improve readability

Demo

SQL>
SQL> DECLARE--   www  .ja  va 2  s . c o  m
  2    salary      NUMBER := 60000;
  3    commission  NUMBER := 0.10;
  4  BEGIN
  5
  6
  7  DBMS_OUTPUT.PUT_LINE('(salary * 0.05) + (commission * 0.25) = '
  8    || TO_CHAR((salary * 0.05) + (commission * 0.25))
  9  );
 10
 11  DBMS_OUTPUT.PUT_LINE('salary * 0.05 + commission * 0.25 = '
 12    || TO_CHAR(salary * 0.05 + commission * 0.25)
 13  );
 14  END;
 15  /
(salary * 0.05) + (commission * 0.25) = 3000.025
salary * 0.05 + commission * 0.25 = 3000.025

PL/SQL procedure successfully completed.

SQL>
SQL>

Related Quiz