Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

OCP-051-006

2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

6. Examine the structure of the SHIPMENTS table:

Check the structure of the 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 dint 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:

You want to generate a report showing the po_id and the amount of the fine. If the SHIPMENT_DATE is one month later than the PO_DTAE, there will be a fine of $20 per day.

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report