Let us understand all the details with respect to Unique Contraints.
- There can be more than one Unique Contraint in a given table.
- Unique Constraint enforces uniqueness but values in the Unique Constraint Columns can be empty.
- Unique Constraint contain one or more columns in a table. If there are more than one column then it is called as composite key .
- Unique Constraint columns can be surrogate where the values might be populated using sequence. However, it is not very common and not a good practice.
- We can define Foreign Key Constraints in Child Tables using Primary Key or Unique Constraints in the table.
- An index will be created when we define Unique Constraint to sort the data and enforce uniqueness.
Click here to go to the topic where we have links for all the important Database Concepts.