求大神解答三道数据库题目。“有3个关系s(sno,sname)、c(cno,cname)、sc(sno,cno,grade)数据表

1.问上课程“db”的学生no(写出SQL语句) 2.成绩最高的学生号(写出SQL语句)3.每科大于90分的人数(写出SQL语句)求大神赐教.提前先说声谢谢!

1

select no from sc where cno in (select cno from c where cname='db')



2

select sno from sc where grade=(select max(grade) from sc)


3

select c.cname,count(*)
from s,c,sc where s.sno=sc.sno and c.cno=sc.cno and sc.grade>90 group by c.cname
温馨提示:答案为网友推荐,仅供参考
相似回答