Mysql data type bitsCN.com
Integer type:
The default value is signed. you can use unsigned to identify unsigned objects.
Create table tbl_int (a tinyint unsigned, // unsigned B tinyint // it is signed by default );
Define the display width:Data type (M) M indicates the minimum display width. The data display width is specified to achieve unified display.
Must be filled with leading zeros. Format: data type(M) zerofill;
alter into tb1_int add c tinyint(2) zerofill;
Decimal type:
FLOAT has a default precision of about 6 to 7 digits. when it is set to 8 digits, the precision will be lost. if the number of decimal places exceeds the limit, it will be rounded down.
DOUBLE has a default precision of 16 to 17 digits. if the number of digits exceeds 16, the number of digits with precision will be reduced to a value greater than the decimal number.
Control the value range:
Type (M, D) MRepresents the number of digits (excluding decimal places and symbols) DNumber of allowed decimal places
create table num_1(A Float(5,2),B double(8,2));
Floating point numbers support scientific notation:
1.2345*10 ^ 3-----1.2345E3
Date and time type:
YEAR Type:
The method for assigning values to fields of the YEAR type:
1. use 4 as a string or number to indicate the input format 'yyyy' or yyyy
BitsCN.com