【12c OCP】最新OCP 12c题库考试原题(071-49题)
最新学讯:近期OCP认证正在报名中,因考试人员较多请尽快报名获取最近考试时间,报名费用请联系在线老师,甲骨文官方认证,报名从速!
我要咨询2018年OCP 11g考试原题解析已经讲解30多次课,500多道考试原题,最终达到98%以上的考题覆盖度及95%以上的考试通过率。
2019年OCP 11g将升级到12c,OCP 12c考试解析免费公开课也已经开始了,欢迎大家收看!
OCP解析公开课时间:【每周五晚8点】
OCP解析公开课地址:http://ke.qq.com/course/326223
OCP解析群资料分享:1015267481 验证:ocp
另外,除了OCP公开课,OCM题库直播也同步进行中,OCM最新题库大爆料-【每周四晚8点】,【微信群直播】,可以联系咨询老师进群参与
-------------------------------------------------------
49、(11-1) 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;)