1z0-071 Exam QuestionsBrowse all questions from this exam

1z0-071 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?

Show Answer
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

7 comments
Sign in to comment
Rik92Option: C
Oct 17, 2022

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

dexdinh91Option: C
Jan 13, 2023

C is correct

meddheddyOption: D
Oct 1, 2022

why D is not true ?

kakamusili
Oct 20, 2022

It would work as well,

Peter_Chen
Oct 20, 2022

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

Antreu
Oct 25, 2022

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

LATI2022Option: C
Oct 27, 2022

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

PuErhOption: B
Mar 23, 2023

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
May 16, 2023

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
Jun 7, 2023

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

TofOra
Feb 2, 2024

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

gurettoOption: C
Oct 25, 2023

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

percyosagOption: C
Apr 26, 2024

c is the answer using ADD_MONTHS(date, n)