CBSE Class 12 Informatics Practices
Question 1 of 79
MySQL SQL Revision Tour — Question 1
Back to all questions 1
Question 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.
- 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 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.