📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

Which SQL statement adds a UNIQUE constraint to an existing Email column?

A. ADD UNIQUE Users.Email
B. ALTER TABLE Users ADD CONSTRAINT UQ_Email UNIQUE (Email) ✅
C. ALTER TABLE Users SET Email UNIQUE
D. CREATE UNIQUE Users

Correct Answer: B. ALTER TABLE Users ADD CONSTRAINT UQ_Email UNIQUE (Email)

Explanation

ALTER TABLE with ADD CONSTRAINT is the standard way to add a named UNIQUE constraint to an existing table.