CREATE OR REPLACE FUNCTION count_classes_per_course (p_course_id IN classes.course_id%type)
RETURN NUMBER
IS
v_nr_c number(6);
begin
select count(class_id) into v_nr_c
from classes
where course_id=p_course_id;
RETURN v_nr_c;
end;