Multiple choice technology databases

what will be the output of: select rpad('*$*',3,'*') from dual;

  1. *$****
  2. *$*
  3. ****$*

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

The RPAD function right-pads a string to a specified length. RPAD('$', 3, '') takes the string '$' which is already 3 characters long, so no padding occurs. The result is simply '$*'. The function would only add asterisks if the original string were shorter than 3 characters.