title: Can't figure out the errors in this pl/ql procedure
body: <p>I want to get the average score from the database and then grade each student in accordance to their average grade.</p>
  
  <pre><code>PROCEDURE avge (stu_id IN NUMBER, z OUT VARCHAR2, lv_avg OUT NUMBER) 
  IS
  BEGIN
    SELECT AVG(SCORE)
      into lv_avg
      FROM GRADE
     WHERE STUDENT_ID = stu_id;
  
    IF (lv_avg BETWEEN 90 AND 100) THEN
       z := 'A';
    ELSIF (lv_avg BETWEEN 80 AND 90) THEN
       z := 'B';
    ELSIF (lv_avg &lt; 80) THEN
       z := 'C';
    END IF; 
  END;
  </code></pre>
  
  <p>These are the errors that pop up are:</p>
  
  <pre><code>ORA-06550: line 5, column 22:
  PL/SQL: ORA-00904: "STU_ID": invalid identifier
  ORA-06550: line 2, column 3:
  PL/SQL: SQL Statement ignored
  ORA-06550: line 6, column 7:
  PLS-00201: identifier 'LV_AVG' must be declared
  </code></pre>