Multiple choice technology databases

Compare the output of the following: SELECT TRUNC(99.57,1) FROM DUAL; and SELECT ROUND(99.57,1) FROM DUAL;

  1. 99.57,99,6

  2. 99.5,99.6

  3. 99.6,99.6

  4. 99.57,99.57

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

TRUNC truncates without rounding, so TRUNC(99.57,1) = 99.5. ROUND rounds to nearest, so ROUND(99.57,1) = 99.6. Option A shows the original value and a truncated 99.6 (wrong). Option C shows both as 99.6 (both rounded, wrong). Option D shows original values unchanged (wrong).

AI explanation

TRUNC(99.57,1) simply cuts off the digits after the first decimal place without rounding, giving 99.5. ROUND(99.57,1) rounds to the nearest tenth, and since the second decimal digit (7) rounds up, it gives 99.6. This distinction — truncation just discards extra digits while rounding adjusts based on their value — is the key difference between the two functions.