How does a UNIQUE constraint contribute to maintaining data integrity?

  • Allows NULL values in columns, ensuring flexibility
  • Ensures that all rows in a table have a unique combination of values in specified columns
  • Forces each row in a table to have a different primary key value
  • Validates that foreign key values exist in the referenced table
A UNIQUE constraint ensures that all rows in a table have a unique combination of values in the specified columns. This helps maintain data integrity by preventing duplicate records, ensuring that each row is distinct based on the defined uniqueness criteria.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *