求每个终点的平均票价的SQL语句是:

admin2010-08-21  17

问题 求每个终点的平均票价的SQL语句是:

选项 A、SELECT终点,avg (票价) FROM ticket GROUP BY 票价
B、SELECT终点,avg (票价) FROM ticket ORDER BY 票价
C、SELECT终点,avg (票价) FROM ticket ORDER BY 终点
D、SELECT终点,avg (票价) FROM ticket GROUP BY 终点

答案D

解析 根据题目的要求,求每个终点的平均票价,则按不同的终点分组查询,用AVG()函数计算每组的平均票价值,故正确SQL语句是:
SELECT终点,avg (票价) FROM ticket GROUP BY 终点
故选项D为正确答案。
转载请注明原文地址:https://jikaoti.com/ti/Jye0FFFM
0

随机试题
最新回复(0)