题库 软件开发 题目列表 mysql中student表中数据如下,查询表中年龄大于18的,...
单选题
mysqlstudent表中数据如下,查询表中年龄大于18的,不同年龄的人数是多少,正确的查询sql是()

+-----+---------+-------+

| id  | name    | age   |

+-----+---------+-------+

|   1 |tom        |   18  |

|   2 |jerry       |   20  |

|   3 |xiaoming |   45  |

|   4 |sunwu     |   18  |

|   5 |liwen       |   18  |

+-----+---------+-------+

A.

SELECT age, count(id) from student GROUP BY age where age>18

B.

SELECT age, count(id) from student GROUP BY age having age>18

C.

SELECT age, sum(*) from student GROUP BY age having age>18

D.

SELECT age, sum(*) from student where age>18 GROUP BY age

题目信息
校招真题
-
正确率
0
评论
11
点击