Hi @LindaWilin1 ,
I have a couple of queries that will return sections for a course, with the second one only returning cross-listed sections in a course. These are for courses that are cross-listed in Canvas. You will, of course, need to modify the query for your CD2 instance.
This query will return all courses for a specific term along with the sections for each course in Canvas:
SELECT c.id AS "course_id", c.sis_source_id, c.course_code, c.name, c.workflow_state, c.account_id, c.enrollment_term_id,
s.id AS "section_id", s.workflow_state, s.sis_source_id, s.name, s.nonxlist_course_id
FROM courses c
INNER JOIN course_sections s ON (c.id = s.course_id)
WHERE c.enrollment_term_id = <term_id_here>;
This query will return courses for a specific term along with only cross-listed sections for each course in Canvas:
SELECT c.id AS "course_id", c.sis_source_id, c.course_code, c.name, c.workflow_state, c.account_id, c.enrollment_term_id,
s.id AS "section_id", s.workflow_state, s.sis_source_id, s.name, s.default_section, s.nonxlist_course_id
FROM courses c
INNER JOIN course_sections s ON (c.id = s.course_id)
WHERE c.enrollment_term_id = <term_id_here>
AND s.nonxlist_course_id is not null;