【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;)