State the output of the following query:-
SELECT MOD(987,0);
State the output of the following query:-
SELECT MOD(987,0);
Solution
✅ Correct Option: 1,4
MOD(x, y) returns the remainder of x divided by y. With a divisor of 0 the result depends on the database. Systems that follow standard division rules, such as PostgreSQL and SQL Server, raise a division-by-zero error, so Option 1 is correct.
Oracle does not raise an error. It defines and returns the first number, 987, so Option 4 is also correct.
Option 3: 0 is the remainder only when the divisor divides the number exactly, and 0 can never be a divisor.
Option 2: no rule of division gives 1 here.
Related questions:
2025: 22 May Shift 1
2025: 16 May Shift 1
2025: 20 May Shift 1