CS FundamentalsModerateTCS NQT · Infosys pattern
A schema uses `salary DECIMAL(8,2)` for a salary column. Which value would be REJECTED when inserted?
- A. 99999.99
- B. 0.01
- C. 123456.78
- 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
- A column is declared VARCHAR(10) vs. CHAR(10). For a value like 'cat' (3 characters), which statement is correct about storage and…
- A query planner chooses a full table scan over using an available index on a WHERE column. Which scenario makes this the RIGHT choice, not…
- Which statement about a query execution plan using a hash join versus a nested-loop join is correct?
- A sort-merge join requires both input relations to be sorted on the join key (or sorted as part of the plan). When is sort-merge join…
- A transaction executes BEGIN; UPDATE accounts SET balance = balance - 100 WHERE id = 1; UPDATE accounts SET balance = balance + 100 WHERE…
- A relation R(A, B, C, D, E) has candidate key AB and no other candidate keys. Which of the following dependencies, if it existed, would…