Since MySQL 4.X, the MOD() function has been included with MySQL. If you are evaluating rational numbers as EVEN or ODD, the MOD function could be used.
See: https://dev.mysql.com/doc/refman/8.0/en/mathematical-functions.html#function_mod
The MOD(x, y) function returns the remainder of X divided by Y.
We can simply use this function to determine if a value is EVEN or ODD by passing the number to evaluate as X and 2 as Y.
Consider the following examples, where we evaluate ODD or EVEN using MOD() for X values 8800 and 8801, and 3:
/* Example 1: X=8800, Y=2 */
SELECT MOD(8800, 2);
-- Returns 0 (remainder == 0, so our number is EVEN)
/* Example 2: X=8801, Y=2 */
SELECT MOD(8801, 2);
-- Returns 1 (remainder > 0, so our number is ODD)
/* Example 3: X=3, Y=2 */
SELECT MOD(3, 2);
-- Returns 1 (remainder > 0, so our number is ODD)
You could extend this a bit, and combine with the IF/ELSE flow control modifier function IF() if you prefer slightly different return values.
See: https://dev.mysql.com/doc/refman/8.0/en/flow-control-functions.html#function_if
The IF(expr1, expr2, expr3) takes 3 arguments. IF() evaluates expr1, and returns expr2 if expr1 evaluates as TRUE. Otherwise, expr3 is returned (there are some caveats, see the MySQL Doc above for further details).
Consider the following examples, where we evaluate ODD or EVEN using MOD() for X values 8800 and 8801 again:
/* Example 1: X=8800, Y=2 */
SELECT IF(MOD(8800, 2)>0,'ODD','EVEN');
-- Returns 'EVEN' (remainder == 0, so our number is EVEN)
/* Example 2: X=8801, Y=2 */
SELECT IF(MOD(8801, 2)>0,'ODD','EVEN');
-- Returns 'ODD' (remainder > 0, so our number is ODD)
Cheers!