Oracle Character functions - Quiz Explanation

The answers you selected are indicated below, along with the text that explains the correct answers.
 
1. Which function can best help you find a word hidden inside a 2000 character text field?
Please select the best answer.
  A. RTRIM
  B. INSTR
  C. SUBSTR
  D. LENGTH
  The correct answer is B. The correct answer is B because the primary purpose of the function INSTR is to find a character or multiple characters (words) inside a string. Although it is possible to search and find a word using RTRIM, it is not the preferred method. Answer C, SUBSTR, is incorrect because it is used to truncate data. Answer D, LENGTH, is incorrect because it is used to find the length of a field.

2. What are the results of the following nested set of functions? (Hint: indenting is not important, but is added for readability.)
SUBSTR('I am Jack Horner.',1, INSTR('I am Jack Horner.','J')-1) || 
SUBSTR('He is Joe Sprat.', INSTR('He is Joe Sprat.','S'))

Please select the best answer.
  A. 'I am Jack Sprat.'
  B. 'I am Joe Sprat.'
  C. 'I am Sprat.'
  D. 'I am JSprat.'
  The correct answer is C, 'I am Sprat.' B is incorrect. You counted to the first letter S, but it is not a match because it is lower case, not upper case. A is incorrect. When completed, the word Joe is removed and the word Jack is reduced to the letter J. D, 'I am JSprat,' is incorrect.
You probably forgot to subtract one when finding the length of the substring. To solve the problem, begin with the inner function of the first line: INSTR('I am Jack Horner.','J') This finds the position of the letter J in the quoted string. The position=6. Next, subtract 1 from the number found. INSTR('I am Jack Horner.','J')-1 Now, substitute 5 (6 minus 1) into the outer function: SUBSTR('I am Jack Horner.',1,5) This says, take 5 characters, starting at the first position. This resolves to: 'I am ' Do the same with the third line. Begin with the inner function on the third line: INSTR('He is Joe Sprat.','S') This finds the position of the letter S in the quoted string. The letter S is in position number 11. Substitute 11 in the outer function: SUBSTR('He is Joe Sprat.', 11) This says take a portion of the quoted string beginning with position 11. This resolves to: 'Sprat.' Finally, concatenate the two results together into the final result: 'I am Sprat.' So, C is the correct answer.

3. Which line of the following query has a syntax error?
1 SELECT RPAD(UPPER(FIRSTNAME||' '||LASTNAME),25,'-+'), 2 LOWER(CITY,INSTR(STATE,'H')), 
3 LPAD(INITCAP(STATE),LENGTH(CITY)) 4 FROM CUSTOMER 
5 WHERE SOUNDEX(LASTNAME) = SOUNDEX('Jonston')

Please select the best answer.
  A. 1
  B. 2
  C. 3
  D. 5
  The correct answer is B.
There are no syntax errors in any line except line 2. Line 2 has too many parameters in the LOWER function. The LOWER function should have only one column or expression or literal inside the parentheses.