1 | tinyint | 1個字節 | (-128)----(128) | 0---255 |
2 | smallint | 2個字節 | -32768----32767 | 0---65535 |
3 | mediumint | 3個字節 | -8388608---8388607 | 0---1677215 |
4 | int | 4個字節 | -2147483648---2147483647 | 0---4294967295 |
5 | bigint | 8個字節 | -9223372036854775808 | 18446744073709551615 |
1 | float | 4個字節 | float(7,4) | float和double都會四捨五入 125.45209 =>125.4521 decimal定位精度數據 125.452090 |
2 | double | 8個字節 | double(7,4) | |
3 | decimal | M+2個字節 | decimal(10,6) |
1 | char | 0-255個字符 | char(32) | |
2 | varchar | 0-65535個字符 | varchar(255) | |
3 | text | 0-65535個字符 | text |
1 | date | 3個字節 | 1000-01-01到9999-12-31 | |
2 | time | 3個字節 | -835:59:59到835:59:59 | |
3 | datetime | 8個字節 | 1000-01-01 00:00:00到9999-12-31 23:59:59 | |
4 | timestamp | 4個字節 | 19700101080001-2038年某個時刻 |