如果C2是课程号如下
select * from score where grade>=60 and grade<=80 and cno='C2'
如果C2是课程名如下
select * from score a, where grade>=60 and grade<=80 and cno=(select cno from course where cname='C2')
每个字段是什么 意思你都不解释下??
select sno,cno,grade
from score left join course on score.cno=course.cno
where cname='c2' and grade between 60 and 80
select b.sno 学号,a.cno 课程号,b.grade 成绩 from course a,score b where a.cno=b.cno
and b.cname='C2'
and grade between 60 and 80
-------------------补充--------------------
和第一个表没啥关系,因为不从第一个表里取东西,只用第二个和第三个就可以了,写的挺明白了,她看了也能懂的吧
select * from score where grade>=60 and grade<=80 and cno='C2'
我觉得这个是对的,就是不知道格式是不是规范,考试对这些小地方也会扣分
我是楼主马甲
例、请查询选修了C2课程的所有学生 的学号和姓名。
SELECT s.sno,s.sname
FROM s,sc
where s.sno=sc.sno and sc.cno=“C2”;
SELECT sno, sname
FROM s where sno IN( SELECT sno FROM sc where cno=“C2”);
这是书上例题