Oracle Database SQL — Question 190
Which two statements will convert the string Hello World to ello world? (Choose two.)
Answer options
- A. SELECT INITCAP(TRIM(‘H’ FROM ‘Hello World’)) FROM DUAL;
- B. SELECT SUBSTR(‘Hello World’, 2) FROM DUAL;
- C. SELECT LOWER(SUBSTR(‘Hello World’, 2, 1)) FROM DUAL;
- D. SELECT LOWER(TRIM(‘H’ FROM ‘Hello World’)) FROM DUAL;
- E. SELECT LOWER(SUBSTR(‘Hello World’, 2)) FROM DUAL;
Correct answer: D, E
Explanation
Answers D and E are correct because they both successfully remove the 'H' from the beginning of 'Hello World' and convert the remaining string to lowercase. Option A does not produce the desired output as it uses INITCAP, which capitalizes the first letter instead of converting the string to lowercase. Option B only removes the first character but does not change the case, and option C retrieves a single character instead of the full string minus the 'H'.