select c.cnum,
c.cname,
count(1) "选课人数",
sum(case
when sc.score < 60 then
1
else
0
end) "不及格人数"
from course c, sections s, sc
where s.cnum = c.cnum
and sc.secnum = s.secnum
group by c.cnum, c.cname
可以使用子查询