• 2022-06-05
    查询选修了数学课(课程号为2)的学生人数,可以使用的查询语句是:  。
    A: SELECT MAX(*) FROM SC WHERE Cno = 2;
    B: SELECT AVG(Sno) FROM SC WHERE Cno = 2;
    C: SELECT COUNT(*) FROM SC WHERE Cno = 2;
    D: SELECT COUNT(Sname) FROM SC WHERE Cno = 2;
  • C

    举一反三

    内容

    • 0

      已知学生选课信息表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='';

    • 1

      已知学生选课信息表: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=

    • 2

      查询所有有成绩的学生学号和课程号。正确的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

    • 3

      查询实现同时选修了C1和C2号课程的学生学号,下列代码正确的是( )。 A: SELECT sno FROM SC WHERE Cno='C1' AND Cno='C2'; B: SELECT sno FROM SC WHERE Cno='C1' AND Sno IN ( SELECT sno FROM SC WHERE Cno='C2' );

    • 4

      针对学生选课表sc(sno, cno, grade),其中sno为学号,cno为课程号,grade为成绩。以下( )语句可查询选修了两门以上成绩在90分以上课程的学生学号。 A: select sno from sc where grade&gt;90 group by sno having count(cno)&gt;2; B: select sno from sc where grade&gt;90 group by sno having count(*)&gt;2; C: select sno from sc where grade&gt;90 and count(*)&gt;2 group by sno; D: select sno from sc where grade&gt;90 group by sno having count(sno)&gt;2;