OCP-051-006
短信预约 -IT技能 免费直播动态提醒
6. Examine the structure of the SHIPMENTS table:
检查表SHIPMENTS 的结构
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一个月,那么将会产生罚款,罚款金额为每天$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.
检查表SHIPMENTS 的结构
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一个月,那么将会产生罚款,罚款金额为每天$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.
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341