add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
DROP TABLE IF EXISTS people;
CREATE TABLE IF NOT EXISTS people (
Id_People smallint(5) unsigned NOT NULL AUTO_INCREMENT,
Firstname varchar(20) NOT NULL,
Lastname varchar(20) NOT NULL,
Birth DATE,
PRIMARY KEY (Id_People)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1002 ;DROP TRIGGER IF EXISTS insert_people;

CREATE TRIGGER insert_people BEFORE INSERT ON people
FOR EACH ROW BEGIN
IF NOT (NEW.Lastname=BINARY UPPER(NEW.Lastname)) THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'the lastname must be in full caps ';
ELSE IF
NOT (ASCII(NEW.Firstname) BETWEEN 65 AND 90 ) THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'the first letter of the firstname must be in caps';
END IF;
END IF;
END
INSERT INTO people VALUES (NULL,'Hallo','Kitty','1980-01-01')
the lastname must be in full caps 
INSERT INTO people VALUES (NULL,'hallo','KITTY','1980-01-01')
the first letter of the firstname must be in caps