120k views
9 votes
Identify the correctly constructed ALTER TABLE statement to add a UNIQUE constraint to the column user_number with the constraint name user_number_unique on the table called 'user'.

User Mbreining
by
4.1k points

1 Answer

10 votes

ALTER TABLE user ADD CONSTRAINT user_number_unique UNIQUE (user_number);

Common mistakes with adding the UNIQUE constraint to an existing column include not having ( ) around the column names, omitting the keyword UNIQUE, incorrectly spelling the column name, and not including the constraint name.

User Faabass
by
4.4k points