• 2022-10-25
    如下⼏个表所示学⽣、课程、必修课和选课关系,⽤SQL语⾔实现下列操作。列出各⻔课的平均成绩、最⾼成绩、最低成绩和选课⼈数。正确的SQL语句是(  )。 
    A: SELECT 课号,AVG(成绩),MAX(成绩),MIN(成绩),COUNT(学号) FROM 选课 GROUP BY 课号;
    B: SELECT 课号,AVG(成绩),MAX(成绩),MIN(成绩),COUNT(学号) FROM 选课 ORDER BY 课号;
    C: SELECT 课号,AVG(成绩),MAX(成绩),MIN(成绩),COUNT(学号) FROM 选课 WHERE 课号;
    D: SELECT 课号,AVG(成绩),MAX(成绩),MIN(成绩),COUNT(学号) FROM 选课 HAVING 课号;
  • 举一反三