After reading a lot of materials related to the Primary key and Unique key, I am in doubt. Let us consider a primary key (AB) in table R (ABCDE). AB together can not be null as AB is a primary key. But, is it possible for a row that A is null? Or, B is null?
$\begingroup$
$\endgroup$
3
-
$\begingroup$ yes, It is possible for "either" of them to be null but not both as both being null would make the primary key null. This further depends on whether A and B allow null values or not $\endgroup$– Rinkesh PCommented Mar 14, 2022 at 13:21
-
$\begingroup$ Thank you @RinkeshP, but then it is going to be the same with a unique key or not? Am I wrong? $\endgroup$– A PaulCommented Mar 14, 2022 at 14:16
-
$\begingroup$ A unique key would allow at most 1 null value but a primary key won't allow null at all. $\endgroup$– Rinkesh PCommented Mar 14, 2022 at 14:23
Add a comment
|