有学生选课表SC(Sno,Cno,Grade),各属性分别为学号、课程号和成绩;完成下列SQL语句:找出每个学生超过他选修课平均成绩的课程号。 SELECT Sno,Cno FROM SC X WHERE() (SELECT() FROM SC Y WHERE Y.Sno=X.Sno)
举一反三
- 有学生选课表SC(Sno,Cno,Grade),各属性为学号,课程号,成绩;完成SQL语句:找出每个学生超过他选修课平均成绩的课程号。 SELECT Sno,Cno FROM SC X WHERE ______ (SELECT ______ FROM SC Y ______);
- 下列SQL语句中,_____________可以在“学生-课程”数据库正确实现“找出每个学生超过他选修课程平均成绩的课程号”。 A: SELECT Sno,CnoFROM SC xWHERE Grade >=(SELECT AVG(Grade) FROM SC y WHERE y.Sno=x.Sno) B: SELECT Sno,CnoFROM SC xWHERE (SELECT AVG(Grade) FROM SC y WHERE y.Sno=x.Sno)<=Grade C: SELECT Sno,CnoFROM SC WHERE Grade >=(SELECT AVG(Grade) FROM SC ) D: SELECT x.Sno,x.CnoFROM SC x, SC yWHERE y.Sno=x.Sno AND x.Grade >=(SELECT AVG(Grade) FROM y)
- 查询所有有成绩的学生学号和课程号。正确的SELECT语句是()。 A: Select sno , cno from sc where grade < > null B: Select sno as 学号, cno as 课程号 from sc where grade is not null C: Select sno , cno from sc where grade !=‘ ’ D: Select sno , cno from sc where grade is not null
- 已知学生选课信息表:sc(sno,cno,grade)。查询“至少选修了一门课程,但没有学习成绩的学生学号和课程号”的SQL语句是( )。 A: SELECT sno,cno FROM sc WHERE grade=NULL B: SELECT sno,cno FROM sc WHERE grade IS C: SELECT sno,cno FROM sc WHERE grade IS NULL D: SELECT sno,cno FROM sc WHERE grade=
- 已知学生选课信息表sc(sno, cno, degree)。查询“至少选修了一门课程,但没有成绩的学生学号和课程号”的SQL语句是( )。 A: SELECT sno, cno FROM sc WHERE degree=NULL; B: SELECT sno, cno FROM sc WHERE degree IS ''; C: SELECT sno, cno FROM sc WHERE degree IS NULL; D: SELECT sno, cno FROM sc WHERE degree='';