• 2022-06-11
    统计选修了a001课程的学生的平均成绩( )
    A: select cid,avg(grade) from student group by cid having cid=’a001’
    B: select cid,avg(grade) from student where cid=’a001’ group by cid
    C: select cid,avg(grade) from course where cid=’a001’ group by cid
    D: select cid,avg(grade) from sc where cid=’a001’ group by cid
  • D

    举一反三

    内容

    • 0

      按照学号进行分组,统计学生的平均成绩,且平均分按降序排列 A: select sid, avg(grade) from sc group by sid order by avg(grade) desc B: select sid, avg(grade) from sc group by cid order by avg(grade) desc C: select sid, avg(grade) from student group by sid order by avg(grade) desc D: select sid, avg(grade) from student group by cid order by avg(grade)

    • 1

      查询学生的学号,姓名,选修课程号和课程成绩 A: select sid,sname,cid,grade from student,sc where student.sid=sc.sid B: select * from student,sc where student.sid=sc.sid C: select sid,sname,cid,cname from student,course D: select sid,sname,cid,cname from student,sc

    • 2

      查询成绩在60分以上的学生的信息及其选课的课程号和成绩 A: select student.*,cid,grade from student,sc where student.sid=sc.sid and grade>=60 B: select * from student,sc where student.sid=sc.sid where grade>=60 C: select * from student,sc where student.sid=sc.sid where student.sid=sc.sid D: select * from student,course where grade>=60

    • 3

      【单选题】假设订单表 orders 用于存储订单信息, cid 代表客户编号, money 代表单次订购额,现要查询每个客户的订购次数和每个客户的订购总金额,则下列() SQL 语句可以返回正确的结果。 A. select cid,count(distinct(cid)),sum(money) from ordersgroup by cid B. select cid , count(distinct(cid)) , sum(money) fromorders order by cid C. select cid , count(cid) , sum(money) from orders orderby cid D. select cid , count(cid) , sum(money) from orders groupby cid

    • 4

      查询选修了2门课程以上的学生学号() A: select sid,count(*) from sc group by sid having count(*)>=2 B: select sid,count(*) from sc group by sid where count(*)>=2 C: select sid,count(*) from sc where count(*)>=2 group by sid D: select sid,count(*) from sc group by cid having count(*)>=2