1.查询sc表中对应何昊老师所教授的女生信息
select s.sname,sc.scgrade,c.cteacher,c.cname from studentcourse sc inner join student s on sc.sno=s.sno inner join course c on sc.cno=c.cno where c.cno=1 and s.sex=‘女’
2.找出没有选修过何老师的课程的所有学生姓名
select sname from student where sname not in(select s.sname from studentcourse sc inner join student s on sc.sno=s.sno inner join course c on sc.cno=c.cno where c.cteacher=‘何昊’ and c.cname=‘java’)
3.列出所有不及格学生的姓名
select sc.scgrade,s.sname from studentcourse sc inner join student s on sc.sno=s.sno where sc.scgrade<60
sql语句练习
最新推荐文章于 2024-08-20 20:45:00 发布