OCP-1Z0-051 第110题 AVG的使用
来源:互联网 发布:软件开发热门发展方向 编辑:程序博客网 时间:2024/05/16 14:41
一、原题
二、题目翻译
三、题目解析
View the Exhibit and examine the structure of the CUSTOMERS table.
Using the CUSTOMERS table, you need to generate a report that shows the average credit limit for customers in WASHINGTON and NEW YORK.
Which SQL statement would produce the required result?
A. SELECT cust_city, AVG(cust_credit_limit)
FROM customers
WHERE cust_city IN ('WASHINGTON','NEW YORK')
GROUP BY cust_credit_limit, cust_city;
B. SELECT cust_city, AVG(cust_credit_limit)
FROM customers
WHERE cust_city IN ('WASHINGTON','NEW YORK')
GROUP BY cust_city,cust_credit_limit;
C. SELECT cust_city, AVG(cust_credit_limit)
FROM customers
WHERE cust_city IN ('WASHINGTON','NEW YORK')
GROUP BY cust_city;
D. SELECT cust_city, AVG(NVL(cust_credit_limit,0))
FROM customers
WHERE cust_city IN ('WASHINGTON','NEW YORK');
答案:C
Using the CUSTOMERS table, you need to generate a report that shows the average credit limit for customers in WASHINGTON and NEW YORK.
Which SQL statement would produce the required result?
A. SELECT cust_city, AVG(cust_credit_limit)
FROM customers
WHERE cust_city IN ('WASHINGTON','NEW YORK')
GROUP BY cust_credit_limit, cust_city;
B. SELECT cust_city, AVG(cust_credit_limit)
FROM customers
WHERE cust_city IN ('WASHINGTON','NEW YORK')
GROUP BY cust_city,cust_credit_limit;
C. SELECT cust_city, AVG(cust_credit_limit)
FROM customers
WHERE cust_city IN ('WASHINGTON','NEW YORK')
GROUP BY cust_city;
D. SELECT cust_city, AVG(NVL(cust_credit_limit,0))
FROM customers
WHERE cust_city IN ('WASHINGTON','NEW YORK');
答案:C
二、题目翻译
查看CUSTOMERS表的结构
使用CUSTOMERS表的数据生成一个报表,显示居住在WASHINGTON和NEW YORK的客户的平均credit limit
哪条SQL语句给出所需结果?
使用CUSTOMERS表的数据生成一个报表,显示居住在WASHINGTON和NEW YORK的客户的平均credit limit
哪条SQL语句给出所需结果?
三、题目解析
AB选项不正确,因为GROUP BY里的分组的列不对,这里应该按cust_city分组。
D选项不正确,因为要根据城市求平均值,所以需要使用GROUP BY子句分组。
D选项不正确,因为要根据城市求平均值,所以需要使用GROUP BY子句分组。
0 0
- OCP-1Z0-051 第110题 AVG的使用
- OCP-1Z0-051 第107题 AVG,MAX,MIN组函数的使用
- OCP-1Z0-051 第99题 AVG函数
- OCP-1Z0-051 第10题
- OCP-1Z0-051 第54题
- OCP-1Z0-051 第60题
- OCP-1Z0-051 第12题 别名的用法
- OCP-1Z0-051 第15题 别名的用法
- OCP-1Z0-051 第40题 视图的注意事项
- OCP-1Z0-051 第41题 视图的注意事项
- OCP-1Z0-051 第42题 视图的注意事项
- OCP-1Z0-051 第44题 SEQUENCE的缺省值
- OCP-1Z0-051 第170题 DELETE的注意事项
- OCP-1Z0-051 第174题 事务的组成
- OCP-1Z0-051 第175题 savepoint的注意事项
- OCP-1Z0-051 补充题库 第1题 TRUNCATE命令的使用
- OCP-1Z0-051 第101题 DECODE,COUNT,CASE WHEN,SUM的使用
- OCP-1Z0-051 第106题 COALESCE,DECODE,NVL,NULLIF函数的使用
- Output Post Processor (OPP)
- linux根目录下各目录的功能
- 【Java】浅析虚拟机结构与机制
- 2014省赛大总结(三) 双线DP
- 新手必备:Linux系统VPS主机SSH常用命令大全
- OCP-1Z0-051 第110题 AVG的使用
- js基础需要注意的点
- 递归输出字符串 经典中的经典
- 分块_莫队算法
- UVA 10025(数学)
- Android 布局Layout详解
- c++ error initialization of "xxx" is skipped by case label
- JavaSE17_多线程
- R Task Views