declare 
v_start_date date:=:start_d;
v_end_date date:=:end_d;
cursor missing_grades_cur
is
select class_id,stu_id,status
from enrollments
where enrollment_date between v_start_date and v_end_date and
final_numeric_grade is null and final_letter_grade is null
order by enrollment_date;
begin
if v_start_date is null and v_end_date is null then 
  v_end_date:=sysdate;
  v_start_date:=add_months(sysdate,-12);
end if;
if v_start_date is null then 
  dbms_output.put_line('introduceti o data de start valida!');
end if;
if v_end_date is null then 
  v_end_date:=sysdate; 
end if;

for v_rec in missing_grades_cur
loop
dbms_output.put_line('class_id '||v_rec.class_id||' student_id '||v_rec.stu_id||' status '||v_rec.status);
end loop;
end;

