加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

OCP-1Z0-051 补充题库 第4题 聚合函数的使用

发布时间:2020-12-13 23:01:52 所属栏目:百科 来源:网络整理
导读:一、原题 See the Exhibit and examine the structure and data in the INVOICE table: Exhibit: Which two SQL statements would executes successfully? (Choose two.) A. SELECT MAX(inv_date),MIN(cust_id) FROM invoice; B. SELECT MAX(AVG(SYSDATE - i
一、原题
See the Exhibit and examine the structure and data in the INVOICE table:
Exhibit:

Which two SQL statements would executes successfully? (Choose two.)
A. SELECT MAX(inv_date),MIN(cust_id) FROM invoice;
B. SELECT MAX(AVG(SYSDATE - inv_date)) FROM invoice;
C. SELECT AVG(inv_date) FROM invoice;
D. SELECT AVG(inv_date - SYSDATE),AVG(inv_amt) FROM invoice;

答案: A,D

二、题目翻译
看下面INVOICE表的结构:
哪两个SQL会执行成功(选择两项)?

三、题目解析
B选项不正确,SYSDATE - inv_date的结果是数字,这里AVG的结果就只有一条记录了,再求MAX,就没意义了,这句会报错。 C选面不正确,inv_date是日期类型,AVG求日期的平均值,会报错。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读