– Student sid sname sage ssex
– Teacher tid tname
– Course cid cname tid
– Score sid cid score
– 10、查询没有学全所有课的学生的学号和姓名
select st.sid,st.sname from Student st
left join (select sid,score from Score where cid=“01”) a
on a.sid=st.sid
left join (select sid,score from Score where cid=“02”) b
on b.sid=st.sid
left join (select sid,score from Score where cid=“03”) c
on c.sid=st.sid
where a.score is null or b.score is null or c.score is null
– 9、查询所有课程成绩小于60分的学生姓名和学号
select st.sid,st.sname from Student st
left join (select sid,score from Score where cid=“01”) a
on a.sid=st.sid
left join (select sid,score from Score where cid=“02”) b
on b.sid=st.sid
left join (select sid,score from Score where cid=“03”) c
on c.sid=st.sid
where (a.score<60 or a.score is null) and (b.score<60 or b.score is null)
and (c.score