- Home
- Class - 12 CBSE Computer Science — Assertion Reason Type Questions
Assertion. The UNIQUE and PRIMARY KEY
Class - 12 CBSE Computer Science — Assertion Reason Type Questions
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.
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.