Which SQL statement is commonly used for testing the integrity of primary keys in a table?

  • ALTER TABLE ... ADD CONSTRAINT ... PRIMARY KEY
  • ASSERT
  • CHECK
  • VALIDATE
The SQL statement commonly used for testing the integrity of primary keys in a table is "ALTER TABLE ... ADD CONSTRAINT ... PRIMARY KEY". This statement is used to add a primary key constraint to a table, ensuring that the specified column(s) uniquely identify each row and enforcing data integrity. By adding a primary key constraint, it becomes impossible to insert duplicate or null values into the primary key column(s), thus maintaining the integrity of the data.
Add your answer
Loading...

Leave a comment

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