Multiple choice technology databases

The o/p of the below two queries will be same ? 1.select translate('abcd','a','d') from dual; 2.select replace('abcd','a','d') from dual;

  1. True

  2. False

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

Both queries replace 'a' with 'd' in 'abcd'. TRANSLATE('abcd','a','d') converts single character 'a' to 'd', giving 'dbcd'. REPLACE('abcd','a','d') replaces substring 'a' with 'd', also giving 'dbcd'. With single-character replacement, they produce identical output.