Which type of constraint in DB2 ensures data integrity by enforcing uniqueness?
- Primary Key
- Foreign Key
- Check Constraint
- Unique Constraint
A Unique Constraint in DB2 ensures data integrity by enforcing uniqueness in a specific column or combination of columns, ensuring that each value in the column(s) is unique across the table. This constraint prevents duplicate entries, ensuring data accuracy and consistency. Therefore, the correct option is a Unique Constraint. Primary Key also enforces uniqueness but additionally implies uniqueness and not nullity, making Unique Constraint a more general answer for ensuring uniqueness.
Loading...
Related Quiz
- What role do user-defined functions play in database queries?
- Scenario: A data analyst needs to generate reports from a DB2 database that involve traversing result sets in both forward and backward directions. How can they achieve this efficiently using cursors in DB2?
- The INSERT INTO statement in SQL is used to ________ new records into a database table.
- In denormalization, what action is taken to reduce the number of joins in SQL queries?
- How can denormalization lead to potential data inconsistency issues?