Oracle Database SQL — Question 109
The PRODUCT_INFORMATION table has a UNIT_PRICE column of data type NUMBER(8,2).
Evaluate this SQL statement:
SELECT TO_CHAR(unit_price, '$9,999') FROM product_information;
Which two statements are true about the output? (Choose two.)
Answer options
- A. A row whose UNIT_PRICE column contains the value 10235.95 will be displayed as $1,0236.
- B. A row whose UNIT_PRICE column contains the value 1023.95 will be displayed as $1,024.
- C. A row whose UNIT_PRICE column contains the value 10235.95 will be displayed as $1,023.
- D. A row whose UNIT_PRICE column contains the value 10235.95 will be displayed as #######.
- E. A row whose UNIT_PRICE column contains the value 1023.99 will be displayed as $1,023.
Correct answer: B, D
Explanation
The correct answer is B because the value 1023.95 will be formatted to $1,024 due to rounding. Option D is also correct as the value 10235.95 exceeds the formatting limit of the TO_CHAR function, resulting in #######. Options A and C are incorrect since they misrepresent the output of the formatting function, and option E is incorrect as well because 1023.99 would be displayed as $1,024 after rounding.