设ABC表有三列A、B、C,并且都是整数类型,则以下( )查询语句能够按照B列进行分组,并在每一组中取C的平均值。A.B.C.D.
A: SELECT AVG(C)FROM ABC
B: SELECT AVG(C)FROM ABC ORDER BY B
C: SELECT AVG(C)FROM ABC GROUP BY B
D: SELECT AVG(C)FROM ABC GROUP BY C,B
A: SELECT AVG(C)FROM ABC
B: SELECT AVG(C)FROM ABC ORDER BY B
C: SELECT AVG(C)FROM ABC GROUP BY B
D: SELECT AVG(C)FROM ABC GROUP BY C,B
举一反三
- 按照学号进行分组,统计学生的平均成绩() A: select sid, avg(grade) from student group by cid B: select sid, avg(grade) from student group by sid C: select sid, avg(grade) from sc group by sid D: select sid, avg(grade) from sc group by cid
- 按照学号进行分组,统计学生的平均成绩,且平均分按降序排列 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)
- 按照课程号进行分组,统计学生平均成绩大于60分的学生的信息( ) A: select cid,avg(grade) from sc group by cid having avg(grade)>60 B: select cid,avg(grade) from student group by cid having avg(grade)>60 C: select cid,avg(grade) from course where avg(grade)>60 group by cid D: select cid,avg(grade) from student where avg(grade)>60 group by cid
- 以下语句错误的是() A: LECT rank, AVG(salary) FROM people HAVING AVG(salary) > 1000 GROUP BY rank; B: SELECT rank, AVG(salary) FROM people GROUP BY rank HAVING AVG(salary) > 1000 C: SELECT rank, AVG(salary) FROM people HAVING AVG(salary) > 1000 GROUP BY rank; D: SELECT AVG(salary) FROM people GROUP BY rank HAVING AVG(salary) > 1000; E: SELECT rank, AVG(salary) FROM people GROUP BY rank WHERE AVG(salary) > 1000;
- 设ABC表的A列存储电话号码信息,查询不是以7开头的所有电话号码的查询语句是( )。 A: SELECT A FROM ABC WHERE A IS NOT ‘%7’ B: SELECT A FROM ABC WHERE A LIKE ‘%7%’ C: SELECT A FROM ABC WHERE A NOT LIKE ‘7%’ D: SELECT A FROM ABC WHERE A LIKE ‘[1-6]%’