What is the output of the following query?
SELECT MOD(98,0);
What is the output of the following query?
SELECT MOD(98,0);
Solution
✅ Correct Option: 3
In MySQL, returns the remainder of divided by . Division by zero is undefined, so returns NULL instead of a number.
MySQL gives no error here (in the default mode). It silently returns NULL.
Option 1: some databases, such as Oracle, return the first number (98) for a zero divisor, but MySQL does not.
Option 2: 0 is the remainder only when the number divides exactly, which is not the case here.
Related questions:
2025: 3 June Shift 2
2025: 30 May Shift 2
2026: 29 May Shift 2
2025: 22 May Shift 1