在except不能运行的情况下如何使用除运算

查询被所有女生选修的课程的课程名称与学分(除运算)
系统的原因不能用except来运算

img

img

img

回答:可以考虑对学生选了的课程进行计数,当选课人数为所有女生总人数时即所有女生都选了的课程

with tmp_table AS (select sno from stu where ssex = 'F')

select cno from course group by cno having count(cno) = (select count(sno) from tmp_table);

表格就简单模拟了一下

img

img