学生表
课程表
老师表
1.查询sc表中对应何昊老师所授课程的女生信息
select stu.sno,stu.sname,stu.age,stu.sex from sc inner join cct on sc.cno = cct.Cno inner join stu on sc.sno = stu.sno where Cteacher = '何昊' and sex = '女';
2.找出没有选修过何老师的课程的所有学生姓名
select stu.sname from stu where not exists(select * from sc,cct where sc.cno = cct.Cno and cct.cteacher='何昊' and sc.sno=stu.sno);
3.列出有不及格课程(成绩小于60)的学生姓名
select DISTINCT(stu.sname) from sc inner join stu on sc.sno = stu.sno where sc.scgrade < '60';