Multiple choice technology databases

select substr('DECCANPARK',-5,6) FROM DUAL

  1. ERROR

  2. NPARK

  3. DECCAN

  4. NULL

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

Oracle's SUBSTR with negative start counts from the string end. -5 points to the 'N' in 'DECCANPARK' (position 6 from start). The length parameter (6) exceeds available characters (only 5 from 'N' to end), so Oracle returns all remaining characters 'NPARK' without error.