Integrity constraints of Mysql columns (set the default value of the table field (DEFAULT))

        When inserting a new record into a database table, if a field is not assigned a value, the database system will automatically insert a default value for this field. In order to achieve this effect, it can be set through the SQL statement keyword DEFAULT.

        It is very simple to set the default value of a field in a database table, which can be realized through the SQL statement DEFAULT in the MySQL database management system, and its syntax is as follows:

CREATE TABLE tablename(

    propName propType DEFAULT defaultvalue, ......

);

Note: If not set, it will be empty by default

Guess you like

Origin blog.csdn.net/m0_65635427/article/details/130307988