Complete the code to create a unique index on the column 'email' in the 'users' table.
CREATE UNIQUE INDEX [1] ON users(email);The index name can be any valid identifier. Here, idx_email_unique clearly indicates a unique index on the email column.
Complete the code to add a unique constraint on the 'username' column in the 'accounts' table.
ALTER TABLE accounts ADD CONSTRAINT [1] UNIQUE (username);The constraint name username_unique clearly indicates a unique constraint on the username column.
Fix the error in the code to create a unique index on 'phone_number' in the 'contacts' table.
CREATE [1] INDEX idx_phone ON contacts(phone_number);The keyword UNIQUE is required to create a unique index. Other options are for different index types.
Fill both blanks to create a unique index named 'idx_unique_code' on the 'code' column of the 'products' table.
CREATE [1] INDEX [2] ON products(code);
The keyword UNIQUE creates a unique index, and the index name should be idx_unique_code as requested.
Fill all three blanks to add a unique constraint named 'uc_email' on the 'email' column of the 'subscribers' table.
ALTER TABLE [1] ADD CONSTRAINT [2] [3] (email);
The table is subscribers, the constraint name is uc_email, and the keyword UNIQUE enforces uniqueness.