Informatics Practices

Assertion. The UNIQUE and PRIMARY KEY constraints are similar but not the same.

Reason. There can be only one column with PRIMARY KEY constraint, in a table.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

SQL Queries

2 Likes

Answer

Both A and R are true but R is not the correct explanation of A.

Explanation
Both the UNIQUE and PRIMARY KEY constraints ensure unique values for each row in a column. However, UNIQUE allows NULL values, whereas PRIMARY KEY does not. There can exist multiple columns with UNIQUE constraints in a table, but only one column can have a PRIMARY KEY constraint.

Answered By

1 Like


Related Questions