The output of the query " Select length(substr('SQL Functions',-10,12)) from dual; " is

  1. 12

  2. 10

  3. 13

  4. error


Correct Option: B

AI Explanation

To answer this question, let's break down the query step by step:

The query is:

Select length(substr('SQL Functions',-10,12)) from dual;
  1. The substr function is used to extract a substring from the given string 'SQL Functions'. The parameters are (string, start_position, length).
  2. In this case, substr('SQL Functions',-10,12) will extract a substring starting from the 10th position from the end (-10) and with a length of 12 characters. So, the extracted substring is ' Functions'.
  3. The length function is then applied to the extracted substring ' Functions', which returns the length of the string.
  4. Finally, the result of the query is the length of the extracted substring, which is 10.

Therefore, the correct answer is B) 10.

Find more quizzes: