im having trouble finding the correct syntax i always having error #1064.
error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ';
this is the code;
DELIMITER $$
DROP FUNCTION IF EXISTS formula$$
CREATE FUNCTION formula(iq INT, sq INT, ig INT) RETURNS INT
BEGIN
DECLARE result INT;
SET result = (iq-((sq/30)) * ig;
IF result >= 0 THEN
RETURN result;
ELSEIF result < 0 THEN
RETURN 0;
END IF;
END; $$
DELIMITER ;
i've searching for the answer in the web nothing i can find. what is the wrong with my syntax?