Most of the programming languages have data types one says, although MySQL's SQL statements are different from standard SQL, the macro view is similar; let's talk about the numeric types in the MySQL database
one, in MySQL there are those types that can represent values :
1, bit[(m)] if M is not specified, in this case the M default is 1, that is, it can only save a bit, one is either zero, or one; M can take it in [1,64]
Mysql> Create TableT (xbit); Query OK,0Rows Affected (0.00sec) MySQL> Insert intoT (x)Values(b'0'); Query OK,1Row affected (0.00sec) MySQL> Insert intoT (x)Values(b'1'); Query OK,1Row affected (0.00sec) MySQL> SelectBin (x) fromT;+--------+|Bin (x)|+--------+| 0 || 1 |+--------+2Rowsinch Set(0.00sec)--since m default is 1, inserting B ' 11 ' is out of rangeMysql> Insert intoT (x)Values(b' One'); ERROR1406(22001): Data tooLong for column 'x'At row1
2, tinyint[(m)] [unsigned] [zerofill] very small integer, it occupies only one byte of storage space, the value range in [-128,127]
3, Bool,boolean It is the alias of tinyint (1), 0 means false not 0 means true
4, smallint[(m)] [unsigned] [zerofill] small integer, it only occupies two bytes of storage space
5, mediumint[(m)] [unsigned] [zerofill] It accounts for only three bytes of storage space
6, int[(m)] [unsigned] [zerofill] integer four bytes of storage space
7, bigint[(m)] [unsigned] [zerofill] Large integer Eight bytes of storage space
8, serial
----
MySQL numberic types----MySQL Numeric type-Introduction