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;

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