QUESTION: 02

On 20 de July de 2007, in 1Z0-001, OCA (PL/SQL Developer), ORACLE, by Fabiano Anjos

You need to analyze how long your orders to be shipped from the date that the order is placed. To do this you must create a report that displays the customer number, date order, date shipped and the number of months in whole numbers from the time the order is placed to the time the order is shipped. Which statement produces the required results?

A: SELECT custid, orderdate, shipdate, ROUND(MONTHS_BETWEEN(shipdate,orderdate)) ‘Time Taken’ FROM ord;
B: SELECT custid, orderdate, shipdate, ROUND(DAYS_BETWEEN(shipdate,orderdate))/30 FROM ord;
C: SELECT custid, orderdate, shipdate, 5 ROUND OFF (shipdate-orderdate) ‘Time Taken’ FROM ord;
D: SELECT custid, orderdate, shipdate, MONTHS_BETWEEN (shipdate,orderdate) ‘Time Taken’ FROM ord;

ANSWER: A

EXPLANATION: Answer A shows the number of months (rounded to integer) between the date of order and the date of shipment.

INCORRECT ANSWERS:

B: Function, function DAYS_BETWEEN shows number of days between shipping date and order date.
C: Incorrect function ROUND OFF.
D: This command will show not rounded to integer value, like 8.6451613.

 

Comments are closed.