title: PL/SQL how to write multiple statement in a single stored procedure
body: <p>I need to do the following problem, </p>
  
  <p>Write a procedure that decreases the salary by a 10% for all employees who earn
  less than the current average salary.
  Treat the content of table EMP as “all employees”. Have your procedure print the name and salary of the first
  person whose salary is just below the average.</p>
  
  <p>What should be the approach to solve the problem? </p>
  
  <p>Write a procedure that decreases the salary by a 10% for all employees who earn less than the current average salary. </p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE UPDATE_EMP IS
  BEGIN
  UPDATE EMP
  SET SAL= SAL-(SAL*0.1) 
  WHERE SAL&lt;(SELECT AVG(SAL) FROM EMP);
  END;
  </code></pre>
  
  <p>AND THE OTHER ONE :
  Have your procedure print the name and salary of the first person whose salary is just below the average.</p>
  
  <pre><code>SELECT e.ename
       , e.sal
   from 
      (select ename
              , sal 
        from emp 
        where sal &lt; (select avg(sal)  
                       from emp
                     ) 
       order by sal desc 
       )e  
    where ROWNUM =1;
  </code></pre>
  
  <p>Now I need to connect both.. How could I do that ...</p>