Multiple choice technology databases

Which three SELECT Statements displays 8000 in the format “$8,000.00”?(Choose three)

  1. A. SELECT TO CHAR(8000,’$#,###.##’) FROM DUAL;
  2. B. SELECT TO CHAR(8000,’$0,000.00’) FROM DUAL;
  3. C. SELECT TO CHAR(8000,’$9,999.00’) FROM DUAL;
  4. D. SELECT TO CHAR(8000,’$9,999.99’) FROM DUAL;
  5. E. SELECT TO CHAR(8000,’$8,000.00’) FROM DUAL;
  6. F. SELECT TO CHAR(8000,’$N,NNN.NN’) FROM DUAL;
Reveal answer Fill a bubble to check yourself
B,C,D Correct answer
Explanation

In Oracle SQL, TO_CHAR format models use 0 and 9 as digit placeholders. 0 displays leading zeros, while 9 displays significant digits only. For 8000 to display as '$8,000.00', we need at least one digit placeholder for the thousands place and two for decimals. Options B, C, and D all achieve this with '$0,000.00', '$9,999.00', and '$9,999.99' respectively - the last option shows decimal places even if zero. Options A and F use incorrect format syntax.