CBSE Class 12 Informatics Practices
Question 2 of 79
MySQL SQL Revision Tour — Question 2
Back to all questions 2
Question Assertion. In terms of values allowed in a column, both UNIQUE and PRIMARY KEY constraints are not the same.
Reason. UNIQUE allows NULL value once in the column, but PRIMARY KEY does not.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Both A and R are true and R is the correct explanation of A.
Explanation
The UNIQUE and PRIMARY KEY constraints are similar in that they both ensure uniqueness of values in a column or set of columns. However, they differ in terms of the values they allow, particularly regarding NULL values. UNIQUE allows NULL values, whereas PRIMARY KEY does not.