The syntax as given in Oracle built-in function, it is to convert lower case letters into upper case letters. The explanation given here is with examples. So that you use in your SQL program directly.
The main advantage of REPLACE function is SQL is to replace a string with another string. Read more.
How to modify SQL in best way is I have given in this post two options. You can choose appropriately.
The best and mostly asked SQL query is converting rows into columns. This is a tricky question and it needs little intelligence to write effectively. This SQL query can be written in two steps with SQL functions either CASE or DECODE.