Complete the code to add a primary key constraint to the 'id' column.
ALTER TABLE employees ADD CONSTRAINT pk_employee_id [1] (id);The PRIMARY KEY constraint uniquely identifies each record in a table.
Complete the code to ensure the 'age' column cannot have NULL values.
ALTER TABLE persons MODIFY age [1];The NOT NULL constraint ensures a column cannot have NULL values.
Fix the error in the code to add a foreign key constraint referencing 'departments(id)'.
ALTER TABLE employees ADD CONSTRAINT fk_dept_id [1] (department_id) REFERENCES departments(id);The FOREIGN KEY constraint links a column to a primary key in another table.
Fill both blanks to create a check constraint that ensures salary is greater than 0.
ALTER TABLE employees ADD CONSTRAINT chk_salary [1] (salary [2] 0);
The CHECK constraint enforces a condition on column values. Here, salary must be greater than 0.
Fill all three blanks to create a unique constraint on the combination of 'email' and 'phone' columns.
ALTER TABLE contacts ADD CONSTRAINT [1] UNIQUE ([2], [3]);
A UNIQUE constraint ensures that the combination of 'email' and 'phone' is unique across all rows. Naming the constraint helps identify it.