SQL Unique Constraint on ALTER Table
We can add a unique column in a table using ALTER.Suppose that we have one table with the named instructor and we want to insert one unique column in the instructor.
Syntax:
ALTER TABLE Instructor
ADD UNIQUE(ID);
SQL | UNIQUE Constraint
SQL Constraints Unique constraints in SQL is used to check whether the sub-query has duplicate tuples in its result. It returns a boolean value indicating the presence/absence of duplicate tuples. Unique constraint returns true only if the subquery has no duplicate tuples, else it returns false.