Not null | NULL: Specifies whether the column can be NULL. If neither NULL nor not null is specified, the column is considered NULL
In MySQL,
Set a NULL value for a not null field,
It does not make errors,
MySQL automatically converts the NULL value to the default value of this field,
You may not explicitly set the default value for this field during table definition.
: "In general, MySQL will automatically add default values for you,
For example
Assigns a NULL value to an integer not null,
The result is 0.
CHAR type
-> '': Null Value
DATATIME
-> '2014-00-00 00:00:00'
And so on.
Top
On the second floor, UNICORN_BX (daily blue) replied with a score of 0 from 11:22:18. That is to say, not null in MySQL is NOT a constraint.
If the field is set to NULL, the value of this field is not given when the record is inserted. MySQL automatically uses the Default value. If no Default value exists, no matter what type the field is, the field value is NULL.
This is the role of not null and NULL in MySQL, that is, the Default value is different when the Default value is NOT defined.