Exam 1z0-071 All QuestionsBrowse all questions from this exam
Question 10

The STORES table has a column START_DATE of data type DATE, containing the date the row was inserted.

You only want to display details of rows where START_DATE is within the last 25 months.

Which WHERE clause can be used?

    Correct Answer: C

    To determine if the START_DATE is within the last 25 months, we can use the MONTHS_BETWEEN function which returns the number of months between two dates. Since we are interested in rows where the START_DATE is within the last 25 months from the current date, we should calculate the number of months between the current date (SYSDATE) and the START_DATE, ensuring this value is less than or equal to 25. Therefore, the appropriate condition is MONTHS_BETWEEN(SYSDATE, start_date) <= 25.

Discussion
dexdinh91Option: C

C is correct

Rik92Option: C

C is true. MONTHS_BETWEEN(date 1, date 2) Oracle gives a positive value when date 1 > date 2 and a negative when date 1 < date 2 https://www.techonthenet.com/oracle/functions/months_between.php

percyosagOption: C

c is the answer using ADD_MONTHS(date, n)

gurettoOption: C

START_DATE stores "the date the row was inserted". Therefore cannot be > SYSDATE (that is "now") and C is the right one

PuErhOption: B

I can't get why the B is incorrect. A negative value is still less than 25. I think I have to check it in DB.

Rik92

The statement in B would indeed result in -25 and thus be correct. But C is the 'cleaner' answer here and thus the one you should pick.

Rik92

The question has been edited and this is no longer an option!

TofOra

"A negative value is still less than 25." Yes, but -30 (meaning 30 months ago) would be less than 25.

LATI2022Option: C

D is false, only put an example between '01/01/200' and '01/02/2002' 25 months but isn't in the last 25 months

meddheddyOption: D

why D is not true ?

kakamusili

It would work as well,

Peter_Chen

Because.....less than 25 months,ex:ˇ26.27.28.29.30 month?

Antreu

if start_date+25 is less than sysdate, then start_date is not in the last 25 months