溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

OCP-051-006

發(fā)布時間:2020-08-09 14:06:42 來源:ITPUB博客 閱讀:114 作者:fwinmachao 欄目:關(guān)系型數(shù)據(jù)庫
6. Examine the structure of the SHIPMENTS table:
    檢查表SHIPMENTS 的結(jié)構(gòu)
name Null Type
PO_ID NOT NULL NUMBER(3)
PO_DATE NOT NULL DATE
SHIPMENT_DATE NOT NULL DATE
SHIPMENT_MODE VARCHAR2(30)
SHIPMENT_COST NUMBER(8,2)

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_DTAE. The penalty is $20 per day.Evaluate the following two queries:
你想生成一個顯示po_id和罰款金額的報表, 如果SHIPMENT_DATE 晚于PO_DTAE一個月,那么將會產(chǎn)生罰款,罰款金額為每天$20.

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. Both execute successfully and give correct results.
B. Only the first query executes successfully but gives a wrong result.
C. Only the first query executes successfully and gives the correct result.
D. Only the second query executes successfully but gives a wrong result.
E. Only the second query executes successfully and gives the correct result.

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI