select folder_id from cr_folders
where label = 'DotLRN Catalog'
select item_id from cr_revisions
where revision_id = :revision_id
select creation_user from acs_objects
where object_id = :object_id
update cr_items
set live_revision = :revision_id
where item_id = ( select item_id from cr_revisions where revision_id = :revision_id )
select item_id from cr_items where name = :name
select count (rel_id)
from acs_rels where object_id_one = :course_id
select rel_id
from acs_rels where object_id_one = :object_one and object_id_two = :object_two
select count (rel_id)
from acs_rels where rel_type = 'dotlrn_catalog_com_rel'
and object_id_two = :community_id
select rel_id
from acs_rels where
(rel_type = 'dotlrn_catalog_class_rel' or rel_type = 'dotlrn_catalog_com_rel')
and object_id_one = :course_id
delete from dotlrn_catalog where course_id = :course_id
delete from cr_revisions where revision_id = :course_id
select 1 from cr_items where live_revision = :revision_id
select 1 from cr_items where latest_revision = :revision_id
select ci.item_id as assessment_id from
cr_folders cf, cr_items ci, cr_revisions cr, as_assessments a
where cr.revision_id = ci.latest_revision and a.assessment_id = cr.revision_id and
ci.parent_id = cf.folder_id
select ci.item_id as assessment_id from
cr_folders cf, cr_items ci, cr_revisions cr, as_assessments a
where cr.revision_id = ci.latest_revision and a.assessment_id = cr.revision_id and
ci.parent_id = cf.folder_id
select count(revision_id) from cr_revisions where item_id = :item_id
select count(rel_id) from acs_rels where object_id_one in (
select revision_id from cr_revisions where item_id = :item_id )
select rel_id from acs_rels where object_id_one in (
select revision_id from cr_revisions where item_id = :item_id )
select om.category_id, om.object_id from category_object_map om where
om.category_id in (select category_id from categories where tree_id =:tree_id)
and om.object_id in (select live_revision from cr_items where content_type = 'dotlrn_catalog')
select course_name as name, course_key as key, course_info as description
from dotlrn_catalog
where course_id=:course_id