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
List triggers
Display triggers defined in the current schema.
OpenIn sheetsqlsame section
Create a scheduled event
Run a periodic cleanup task inside MySQL.
OpenIn sheetsqlsame section
List events in a database
Inspect scheduled events.
OpenIn sheetsqlsame section
Drop a trigger
Remove a trigger definition.
OpenIn sheetsqlsame section
Change the statement delimiter
Define routines containing semicolons.
Call a stored procedure
Execute a procedure with input arguments.