09, MySQL- column properties

  Also known as field attribute column properties, a total of six attributes in mysql: null, a default value, column descriptions, primary keys, automatic keys and unique growth

1, Null property

NULL attribute : Represents field empty

 

  If the corresponding value of YES indicates that the field may be NULL

note:

(1) In the design of the table, try not to let the data is empty

(2) Mysql record length of 65,535 bytes, if a table has a field allowed is NULL, then the system will be designed that retain a memory byte NULL, the final effective length of 65,534 bytes is stored.

2, the default value

Default: default value , when the field is designed, if the default conditions permit, the user does not insert the data, then the data may be used to fill the prepared: Generally filled with NULL

 

Test: insert data - no data value is provided to a current field

 

   Default another layer using keywords: display informing field default value: performing data when inserted, directly use the default value for the field

 

 3 , column describes

Column Description: comment, it is a dedicated maintenance explanatory notes to developers

The basic syntax:

comment 'Field Description';

 

View Comment: Statement by looking at the table must be created

 

Guess you like

Origin www.cnblogs.com/CSAH/p/11141298.html