Multiple choice technology databases

select next_day('19-SEP-09','FRIDAY') from dual and select next_day('19-SEP-09',7) from dual would results in?(answers in mm/dd/yyyy formate)

  1. syntax error and 09/26/2009,

  2. 09/25/2009 and 09/25/2009

  3. 09/25/2009 and syntax error

  4. 09/25/2009,09/26/2009

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

NEXT_DAY('19-SEP-09', 'FRIDAY') finds the first Friday on or after Sept 19, 2009. Sept 19, 2009 is a Saturday, so the next Friday is Sept 25, 2009. NEXT_DAY('19-SEP-09', 7) does the same - 7 represents Friday in Oracle (1=Sunday). Both return 09/25/2009.