Multiple choice technology databases

The output of the query " select translate('123456789','235','xy') from dual; " is

  1. 1x4y6789

  2. 1xy456789

  3. 1xy46789

  4. error

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

TRANSLATE('source', 'from', 'to') replaces each character in 'from' with corresponding character in 'to'. Here: '235' maps to 'xy' (2→x, 3→nothing, 5→y). So '123456789' becomes '1xy46789' - 2 becomes x, 3 is removed, 5 becomes y. The key is understanding that 3 maps to empty string.