Which SELECT statement will the result 'ello world' from the string 'Hello World'?

  1. SELECT SUBSTR ('Hello',) FROM dual;

  2. SELECT INITCAP (TRIM ('Hello World',1,1) FROM dual;

  3. SELECT LOWER (SUBSTR ('Hello World',1,1) FROM dual

  4. SELECT LOWER (SUBSTR ('Hello World',2,1) FROM dual;

  5. SELECT LOWER (TRIM ('H' FROM 'Hello World')) FROM dual;


Correct Option: E

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) SELECT SUBSTR ('Hello',) FROM dual; This option is incorrect because the SUBSTR function requires three arguments: the string, the starting position, and the length. In this case, the starting position and length are not provided.

Option B) SELECT INITCAP (TRIM ('Hello World',1,1) FROM dual; This option is incorrect because the TRIM function is used to remove specified characters from the beginning and/or end of a string. In this case, the starting position and length are not provided correctly.

Option C) SELECT LOWER (SUBSTR ('Hello World',1,1) FROM dual This option is incorrect because the SUBSTR function is used to extract a substring from a string. In this case, it is extracting the first character 'H' and converting it to lowercase using the LOWER function. It does not provide the desired result 'ello world'.

Option D) SELECT LOWER (SUBSTR ('Hello World',2,1) FROM dual; This option is incorrect because the SUBSTR function is used to extract a substring from a string. In this case, it is extracting the second character 'e' and converting it to lowercase using the LOWER function. It does not provide the desired result 'ello world'.

Option E) SELECT LOWER (TRIM ('H' FROM 'Hello World')) FROM dual; This option is correct because it uses the TRIM function to remove the letter 'H' from the string 'Hello World'. It then converts the remaining string 'ello world' to lowercase using the LOWER function. This provides the desired result 'ello world'.

The correct answer is Option E.

Find more quizzes: