1z0-061 Exam QuestionsBrowse all questions from this exam

1z0-061 Exam - Question 5


Which three SQL statements would display the value 1890.55 as $1, 890.55?

Show Answer
Correct Answer: AD

The SQL TO_CHAR function can be used to format the number 1890.55 as $1,890.55 using specific formatting codes. The correct formats needed here include using '$' for the dollar sign, 'G' for the group separator, 'D' for the decimal separator, and '0' or '9' for digit placeholders. 'A' uses '$0G000D00', which correctly adds separators. 'D' uses '$99G999D00', which also correctly formats the number with group and decimal separators. 'E' uses '$99G999D99', which is another correct way to achieve the desired format. 'B' and 'C' are incorrect due to either the incorrect usage of 'V' or an invalid number format model in Oracle SQL.

Discussion

8 comments
Sign in to comment
cnyce
May 13, 2019

Questions asks for "3" answers...wouldn't "E" be correct as well?

Sugar
Jul 23, 2019

This question is wrong. it says which three statements, it should rather which four statements. A C D E are all the correct answers. this only gave A D answers.

luizyto
Aug 19, 2019

C is not correct....

[Removed]
Aug 19, 2019

select to_char(1890.55,'$0G000D00') from dual; --correct select to_char(1890.55,'$9,999V99') from dual; --incorrect select to_char(1890.55,'$99,999D99') from dual; --ora-01481 "invalid number format model" select to_char(1890.55,'$99G999D00') from dual; --correct select to_char(1890.55,'$99G999D99') from dual; --correct

hunghaubs
Sep 12, 2019

ADE correct

Fatthalla
Feb 19, 2020

Please correct this Question.

minevra
Oct 14, 2021

the question ask for 1,890.55 but the A,C and D option gives the result that 1.890,55 If this correct, the right aswers A,C and D. otherwise none of them is corrent.

Blob44
Nov 21, 2022

ADE 0 Returns leading zeros./ Returns trailing zeros. 9 Returns value with the specified number of digits with a leading space if positive or with a leading minus if negative. Leading zeros are blank, except for a zero value, which returns a zero for the integer part of the fixed-point number. G Returns in the specified position the group separator (the current value of the NLS_NUMERIC_CHARACTER parameter). You can specify multiple group separators in a number format model.Restriction: A group separator cannot appear to the right of a decimal character or period in a number format model. V Returns a value multiplied by 10n (and if necessary, round it up), where n is the number of 9's after the V.