Complete the code to add a UNIQUE constraint to the 'email' column in the 'users' table.
ALTER TABLE users ADD CONSTRAINT [1] UNIQUE (email);The UNIQUE constraint requires a name, here 'unique_email' is a valid constraint name.
Complete the code to create a table 'products' with a UNIQUE constraint on the 'sku' column.
CREATE TABLE products (id INT PRIMARY KEY, sku VARCHAR(50) [1] UNIQUE);
The 'sku' column should be NOT NULL to enforce uniqueness properly.
Fix the error in the code to add a UNIQUE constraint on 'username' in the 'accounts' table.
ALTER TABLE accounts ADD UNIQUE [1] (username);The constraint name should be a valid identifier; 'unique_username' is clear and valid.
Fill both blanks to create a UNIQUE constraint on 'email' and 'phone' columns in 'contacts' table.
ALTER TABLE contacts ADD CONSTRAINT [1] UNIQUE ([2]);
The constraint name 'unique_contact' is valid, and columns must be listed without spaces after commas.
Fill all three blanks to create a table 'employees' with a UNIQUE constraint on 'email' and 'employee_id'.
CREATE TABLE employees (id INT PRIMARY KEY, [1] VARCHAR(100) NOT NULL, [2] INT NOT NULL, CONSTRAINT [3] UNIQUE (email, employee_id));
'email' and 'employee_id' columns are defined, and 'unique_emp' is the constraint name.