In the below SQL code is 'NOT NULL' redundant since f_ID is a primary key and thus can't be null for any record?
CREATE TABLE t_Activities(
f_ID varchar(50) NOT NULL,
PRIMARY KEY (f_ID))
What if you later drop the primary key constraint? Should the column allow nulls or not after that? Yes, no, maybe? The two constraints are different. PK constraint requires a NOT NULL, but does not implies one.
It may be redundant, but I prefer this method of creating a primary key (or Identity column). It shows that the person making the table understands and intends the column to be NOT NULL as well as the Primary Key for the table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With