exam questions

Exam 1z0-071 All Questions

View all questions & answers for the 1z0-071 exam

Exam 1z0-071 topic 1 question 10 discussion

Actual exam question from Oracle's 1z0-071
Question #: 10
Topic #: 1
[All 1z0-071 Questions]

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?

  • A. WHERE TO_NUMBER(start_date - SYSDATE) <= 25
  • B. WHERE MONTHS_BETWEEN(start_date, SYSDATE) <= 25
  • C. WHERE MONTHS_BETWEEN(SYSDATE, start_date) <= 25
  • D. WHERE ADD_MONTHS(start_date, 25) <= SYSDATE
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Drexan
2 months, 2 weeks ago
Selected Answer: C
months_between.. The interval is important, and if I add 25 months to a date 3 years ago, it will not be in the desired interval... disregar my previous comment
upvoted 1 times
...
Drexan
2 months, 2 weeks ago
Selected Answer: C
ADD_Months
upvoted 1 times
...
percyosag
8 months, 2 weeks ago
c is the answer using ADD_MONTHS(date, n)
upvoted 1 times
...
guretto
1 year, 2 months ago
START_DATE stores "the date the row was inserted". Therefore cannot be > SYSDATE (that is "now") and C is the right one
upvoted 1 times
...
PuErh
1 year, 9 months ago
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.
upvoted 1 times
TofOra
11 months, 2 weeks ago
"A negative value is still less than 25." Yes, but -30 (meaning 30 months ago) would be less than 25.
upvoted 1 times
...
Rik92
1 year, 8 months ago
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.
upvoted 1 times
Rik92
1 year, 7 months ago
The question has been edited and this is no longer an option!
upvoted 1 times
...
...
...
dexdinh91
1 year, 12 months ago
Selected Answer: C
C is correct
upvoted 2 times
...
LATI2022
2 years, 2 months ago
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
upvoted 1 times
...
Rik92
2 years, 2 months ago
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
upvoted 2 times
...
meddheddy
2 years, 3 months ago
why D is not true ?
upvoted 1 times
kakamusili
2 years, 2 months ago
It would work as well,
upvoted 1 times
...
Peter_Chen
2 years, 2 months ago
Because.....less than 25 months,ex:ˇ26.27.28.29.30 month?
upvoted 2 times
...
Antreu
2 years, 2 months ago
if start_date+25 is less than sysdate, then start_date is not in the last 25 months
upvoted 1 times
zzsqlcoder
3 months, 3 weeks ago
Yes because if we try a date that is 30 months before, if we add 25 months it is still less than SYSDATE so the condition will result true. That's why C is the only alternative
upvoted 1 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago