Oracle Database 11g: SQL Fundamentals I — Question 2
Which three SQL statements would display the value 1890.55 as $1,890.55? (Choose three.)
Answer options
- A. SELECT TO_CHAR(1890.55,'$99G999D00')FROM DUAL;
- B. SELECT TO_CHAR(1890.55,'$9,999V99')FROM DUAL;
- C. SELECT TO_CHAR(1890.55,'$0G000D00')FROM DUAL;
- D. SELECT TO_CHAR(1890.55,'$99G999D99')FROM DUAL;
- E. SELECT TO_CHAR(1890.55,'$9,999D99')FROM DUAL;
Correct answer: A, C, D
Explanation
The correct answers are A, C, and D because they all format the number correctly with the appropriate use of the grouping symbol and decimal places. Option B is incorrect as it uses a 'V' instead of a 'D', which does not correctly represent the decimal point in this context, and option E does not include the correct number of decimal places required for the formatting.