大数据就业实战培训 Oracle就业实战培训

CUUG,以就业为导向,让学员学到真正实用的技术

当前位置: CUUG培训-优技培训 >> 071考试 >

【071考试】最新OCP认证071考试题库整理-第49题

【071考试】最新OCP认证071考试题库整理-第49题

来源:CUUG培训-优技培训    更新时间:2019/6/3 14:12:31    阅读次数:

071考试题库之前是比较稳定的,但随着Oracle的调整,071考试不断的增加新的考题,增加了考试的难度,所以我们专门收集整理了这些考试,并对这些考题进行解析,希望可以对考生有帮助。

每周五晚8点,我们有免费的OCP解析公开课,地址:https://ke.qq.com/course/326223  OCP题库交流群:1015267481,验证ocp

-------------------------------------------------------

071考试-第49题、choose the best answer

Examine the structure of the SHIPMENTS table:

You want to generate a report that displays the PO_ID and the penalty amount to be paid(罚款数额) if the SHIPMENT_DATE is later than one month from the PO_DATE. The penalty is $20 per day.

Evaluate the following two queries:

SQL> SELECT po_id, CASE

WHEN MONTHS_BETWEEN (shipment_date,po_date)>1 THEN

TO_CHAR((shipment_date - po_date)*20) ELSE 'No Penalty' END PENALTY

FROM shipments;

SQL>SELECT po_id, DECODE

(MONTHS_BETWEEN(po_date,shipment_date)>1,

TO_CHAR((shipment_date - po_date) * 20, 'NO Penalty') PENALTY

FROM shipments;

Which statement is true regarding the above commands?

A) Only the second query executes successfully but gives a wrong result.

B) Only the second query executes successfully and gives the correct result.

C) Only the first query executes successfully but gives a wrong result.

D) Both execute successfully and give correct results.

E) Only the first query executes successfully and gives the correct result.

Answer:E

(解析:decode 函数的语法是,decode(条件,值 1,返回值 1,值 2,返回值 2,...值 n,返回值 n,缺省值),

所以不能有>1 的条件判断。原来 051 的题。

该语句可以改写为下面的语句:

SELECT empno,hiredate,

CASE

WHEN MONTHS_BETWEEN (sysdate,hiredate)>1

THEN TO_CHAR((sysdate - hiredate )*20)

ELSE 'No Penalty'

END PENALTY

FROM emp;)

071考试
大数据课程
WDP
oracle机构
oracle认证
oracle课程
oracle视频
CUUG就业实战培训
CUUG与ORACLE公司建立最核心、最权威、最深层次的战略合作伙伴关系;
CUUG是唯一一家只做DBA就业培训和oracle认证的授权机构,28年培养数万名oracle技术人才;
CUUG金牌讲师授课,来自一线的资深ORACLE OCM技术专家团队;
CUUG顶尖完善的学习体系,以甲骨文原厂ORACLE数据库核心技术为教学课程;

报名入口 点击进入

课程咨询:400-0909-964

考试咨询:400-0909-964

QQ:点击获取

E-mail:yuezt@cuug.com