Towards the end of chapter 1 under the sub-topic "Default Values" there is this example -
CREATE TABLE doughnut_list ( doughnut_name VARCHAR (10) NOT NULL, doughnut_type VARCHAR (6) NOT NULL, doughnut_cost DEC(3,2) NOT NULL DEFAULT 1.00 );
I have a doubt in line (3) of the SQL query -
The definition of NOT NULL - All columns should have a value
The definition of Default - If no value is passed then it considers a default value in this case 1.00
I think NOT NULL and DEFAULT are contradicting each other here, if the user has to provide a value (NOT NULL) then the need for DEFAULT will never arise. So I guess, DEFAULT command must be used minus the NOT NULL
Please correct me if I am wrong.
Thanks in advance.