Write the following queries in SQL using the university schemaFind all course sections offered in Spring 2020 along with the names of the instructors teaching the section Display course ID section id
SELECT c.course_id, s.section_id, COALESCE(i.instructor_id, '—') AS instructor_id, COALESCE(i.name, '—') AS instructor_name FROM course c JOIN section s ON c.course_id = s.course_id LEFT JOIN teaches t ON s.course_id = t.course_id AND s.section_id = t.section_id LEFT JOIN instructor i ON t.instructor_id = i.instructor_id WHERE s.semester = 'Spring' AND s.year = 2020;
原文地址: http://www.cveoy.top/t/topic/bluq 著作权归作者所有。请勿转载和采集!