Normalize row data before insert.
Section: triggers and events
Create a BEFORE INSERT trigger
sql
sql
DELIMITER $$
CREATE TRIGGER trg_users_before_insert
BEFORE INSERT ON users
FOR EACH ROW
BEGIN
SET NEW.email = LOWER(NEW.email);
END $$
DELIMITER ;Explanation
Triggers can enforce lightweight normalization close to the data layer.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing triggers and events