mysql database, navicat tool.
Premise, this field is set to NOT NULL, so the default value cannot be set to Null.
But the other two are OK, and they do not affect normal data addition, deletion, modification and query, and Null values cannot be inserted.
Please read it clearly before answering.
I am not talking about null and empty string, but the difference between "fill in nothing" and empty string.
Give me an example of a table creation statement:
The difference between add coloum 'name' char(50) not null; and
add coloum 'name' char(50) default '' not null;
.
In addition, regardless of whether default is set or not, since the field itself is restricted to not null,
so the value inserted into the database will become an empty string.
So, I ask: the difference between the default values when building a table using the "navicat" tool.
Please look at the picture before answering, thank you.
not null If there is no default and you don’t assign a value, it won’t be inserted, and cmd will report an error.
If you don’t report an error, it’s because your program or tool has compensated itself