Which query gives the correct output?

Examine the structure of the PROMOS table:


You want to display the list of promo names with the message ‘Same Day’ for promos that started and ended on the same day.
Which query gives the correct output?
A. SELECT promo_name, NVL(NULLIF(promo_start_date, promo_end_date), ‘Same Day’) FROM promos;
B. SELECT promo_name, NVL(TRUNC(promo_end_date - promo_start_date), ‘Same Day’) FROM promos;
C. SELECT promo_name, NVL2(TO_CHAR(TRUNC(promo_end_date-promo_start_date)), NULL,’Same Day’)FROM promos;
D. SELECT promo_name, DECODE((NULLIF(promo_start_date, promo_end_date)), NULL,’Same day’) FROM promos;

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.