OA. free
Free
Ukg Core Cs & Systems Core Computer Science Medium

What is the output of the following SQL statement?

Ukg technical mcq question, verified with a worked answer. Free to practise - no sign-up.

What is the output of the following SQL statement?

SELECT ROUND(45.926, -2) FROM DUAL;
Choose one option.
Show answer & explanation
Answer: A. 0

In Oracle SQL, a negative second argument in ROUND rounds to the left of the decimal point. Here, -2 rounds to the nearest hundred, and 45.926 is closer to 0 than to 100.

Step-by-step Derivation:
Step 1: ROUND(value, n) rounds to n decimal places. If n is negative, it rounds to digits to the left of the decimal point.
Step 2: For n = -2, rounding is to the nearest 100.
Step 3: The value 45.926 lies between 0 and 100. Distance to 0 is 45.926, and distance to 100 is 54.074.
Step 4: Since 45.926 is closer to 0, the result is 0.