CS FundamentalsModerateTCS NQT · Infosys pattern

A schema uses `salary DECIMAL(8,2)` for a salary column. Which value would be REJECTED when inserted?

  1. A. 99999.99
  2. B. 0.01
  3. C. 123456.78
  4. D. 1234567.89

Correct answer: D. 1234567.89

DECIMAL(8,2) allows 8 total significant digits, 2 of them after the decimal point — so up to 6 digits before the point and 2 after (max 999999.99). 1234567.89 needs 7 digits before the decimal point, exceeding the precision, and is rejected; the others all fit within 6 digits before the point.

More DBMS and SQL questions

Exams that ask this topic