Metoda I

CREATE OR REPLACE PROCEDURE show_class_offerings(p_start_date IN classes.start_date%type,p_end_date IN classes.start_date%type )
AS
cursor show_c_o_cur is
select cl.class_id, cl.start_date, a.first_name, a.last_name, cl.course_id, c.title, c.section_code
from classes cl join instructors a on cl.instr_id=a.instructor_id join courses c on cl.course_id=c.course_id
where cl.start_date between p_start_date and p_end_date;
begin
for show_c_o_rec in show_c_o_cur
loop
dbms_output.put_line(show_c_o_rec.class_id||' '||show_c_o_rec.start_date||' '||show_c_o_rec.first_name||' ' ||show_c_o_rec.last_name||' '||show_c_o_rec.title||' '||show_c_o_rec.section_code||compute_avarage_grade(show_c_o_rec.course_id));
end loop;
end;

Metoda II

CREATE OR REPLACE PROCEDURE show_class_offerings(p_start_date date,p_end_date date)
AS

   CURSOR c1 IS SELECT course_id,class_id,start_date,instr_id FROM classes WHERE start_date BETWEEN p_start_date AND p_end_date;
   CURSOR c2(p_course_id NUMBER,p_instr_id NUMBER) IS SELECT i.first_name,i.last_name,c.title,c.section_code 
       FROM courses c, instructors i 
       WHERE c.course_id = p_course_id AND i.instructor_id=p_instr_id; 
   
BEGIN 
   DBMS_OUTPUT.PUT_LINE('Date range: Between '||p_start_date||' and '||p_end_date||'.'); 
   DBMS_OUTPUT.PUT_LINE('Classes Information.'); 
   FOR v_c1 IN c1 LOOP
     FOR v_c2 in c2(v_c1.course_id,v_c1.instr_id) LOOP
        DBMS_OUTPUT.PUT_LINE('Class ID '||v_c1.class_id||' Start Date'||v_c1.start_date||' Instructor '||v_c2.first_name||' '||v_c2.last_name||' Course Title '||v_c2.title ||' Section Code '||v_c2.section_code||compute_avarage_grade(v_c1.class_id)); 
     END LOOP; 
   END LOOP; 
end;

begin
show_class_offerings('01-jun-2004','01-sep-2009');
end;