1BEGIN
2 IF (DATEDIFF(CURRENT_DATE(),NEW.birth_date) < 6570) THEN
3
4 -- Throw Exception
5 SIGNAL SQLSTATE '45000'
6 SET MESSAGE_TEXT = 'Age is less than 18 years!';
7
8 END IF; -- A semicolon (delimiter) is missing here
9END