Multiple choice technology databases

What is the result of the following SQL statement? SELECT INDEX (SUBSTRING ('RALPH JOHNSON' FROM 6 FOR 5), 'OHN');

  1. 3

  2. 5

  3. 6

  4. 2

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

SUBSTRING('RALPH JOHNSON' FROM 6 FOR 5) extracts 5 characters starting at position 6, which yields ' JOHN'. The INDEX function then searches for 'OHN' within ' JOHN'. 'OHN' starts at the 3rd character of ' JOHN' (space is 1, J is 2, O is 3), returning 3.