Question: Find the semester when both Master students and Bachelor students got enrolled in.
Schema: create table degree_programs (degree_program_id varchar, PRIMARY KEY (degree_program_id)); create table student_enrolment (semester_id varchar, degree_program_id varchar, PRIMARY KEY (semester_id))
SQL: select distinct t2.semester_id from degree_programs as t1 join student_enrolment as t2 on t1.degree_program_id = t2.degree_program_id where degree_summary_name = 'master' intersect select distinct t2.semester_id from degree_programs as t1 join student_enrolment as t2 on t1.degree_program_id = t2.degree_program_id where degree_summary_name = 'bachelor'