Multiple choice technology databases

select replace('abcda','ab','ef') from dual ; The o/p would be..

  1. efcda

  2. efcde

  3. ef

  4. ab

  5. 1

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

The REPLACE function replaces all occurrences of the search substring with the replacement substring. Since 'ab' is only at the beginning of 'abcda', it is replaced by 'ef', resulting in 'efcda'. The 'a' at the end is left unchanged because it is not part of an 'ab' pair.