Problem Description

In Users(email), you want emails to be unique even if case differs (A@x.com vs a@x.com). Write one practical approach using a stored generated column lower_email and a UNIQUE constraint on it.

Input Format

SQL DDL

Output Format

DDL statement(s)

Sample Test Case

Input:
Users(user_id, email)
Output:
Unique enforced

Constraints

If your DB does not support generated columns, use triggers instead

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next