Compute a lowercased email for indexing or search.
Section: Triggers and generated values
Normalize data with a generated column
sql
sql
CREATE TABLE contacts (
id INTEGER PRIMARY KEY,
email TEXT NOT NULL,
email_normalized TEXT GENERATED ALWAYS AS (lower(email)) STORED
);Explanation
Generated columns can simplify lookups and enforce repeatable derivations close to the data.
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 generated values