Write the output produced by the following SQL command:
SELECT ROUND(342.9234,-1);
Write the output produced by the following SQL command:
SELECT ROUND(342.9234,-1);
Solution
✅ Correct Option: 1
ROUND(x, d) rounds x to d places. When d is negative, the rounding happens to the left of the decimal point, so rounds to the nearest ten.
In 342.9234, the units digit is 2, which is less than 5, so the tens digit stays the same. The result is 340, with no decimal part.
Options 2 and 3: these treat the digits after the decimal point as if were positive. A negative never keeps decimal places.
Option 4: the result has zero decimal places, so it is displayed as 340, not 340.0.
Related questions:
2026: 18 May Shift 2