Which statement is true regarding the above commands?

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:
Which statement is true regarding the above commands?

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:
Which statement is true regarding the above commands?

A.
Only the first 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 and gives the correct result.

D.
Both execute successfully and give correct results.

E.
Only the second query executes successfully but gives a wrong result.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


helion

helion

C.

SELECT
PO_ID,
CASE
WHEN MONTHS_BETWEEN(SHIPMENT_DATE,PO_DATE) > 1 THEN TO_CHAR((SHIPMENT_DATE-PO_DATE) * 20)
ELSE ‘No Panalty’
END PENALTY
FROM SHIPMENTS;

PO_ID PENALTY
———- —————————————-
1 No Panalty
22 29660.0018518518518518518518518518518519

SELECT
PO_ID,
DECODE( MONTHS_BETWEEN(SHIPMENT_DATE,PO_DATE) > 1, TO_CHAR((SHIPMENT_DATE-PO_DATE) * 20),’No Panalty’) PENALTY
FROM SHIPMENTS;

Erro de SQL: ORA-00907: missing right parenthesis