insert into dotlrn_classes
(class_key, department_key)
values
(:class_key, :department_key)
select node_id
from site_nodes
where object_id = (select package_id
from dotlrn_classes_full
where class_key = :class_key)
select term_id
from dotlrn_class_instances
where class_instance_id = :class_instance_id
select count(*)
from dual
where exists (select 1
from dotlrn_departments)
select 1
from dotlrn_classes
where dotlrn_classes.class_key = :class_key