Help regarding Number data type
842382May 16 2011 — edited May 16 2011Hi,
2. After describing the EMPLOYEES table, you discover that the SALARY column has a data
type of NUMBER(8,2). Which SALARY value(s) will not be permitted in this column?
(Choose all that apply.)
A. SALARY=12345678
B. SALARY=123456.78
C. SALARY=12345.678
D. SALARY=123456
E. SALARY=12.34
Answer: A and C. Columns with NUMBER(8,2) data type can store, at most, eight digits; of which,
at most, two of those digits are to the right of the decimal point. Although A and C are the
correct answers, note that since the question is phrased in the negative, these values are NOT
allowed to be stored in such a column. A is not allowed because it contains eight whole number
digits, but the data type is constrained to store six whole number digits and two fractional digits.
C is not allowed since it has three fractional digits and the data type allows a maximum of two
fractional digits.
I Found this in "OCA Oracle Database 11g: SQL Fundamentals I Exam Guide (Exam 1Z0-051)" book
Is this correct? Is 'C'(12345.678) not a valid input?
In my opinion 'C' is a valid and that should display 12345.68 when we retrieve.
Could you please clarify my doubt
Thanks
Praveen