Basic mysql Data Types
1. Data type refers to the data features of columns, stored procedure parameters, expressions, and local variables. It determines the data storage format and represents different information types.
2. The larger the storage range, the larger the occupied space.
3. Integer Data Types (in ascending order of storage capacity): TINTINT, SMALLINT, MEDIUMINT, INT, BIGINT
4. FLOAT Type: FLOAT [(M, D)]: M indicates the total number of digits, and D indicates the number of digits after the decimal point. If M and D are omitted, the values are saved according to the restrictions allowed by the hardware. The single-precision floating point number is precise to about 7 decimal places.
5. DATE type: YEAR, TIME, DATE, DATETIME, TIMESTAMP. In actual development, the date type is rarely used. Generally, the number type is used.
6. character Type: CHAR (M): M bytes, 0 <= M <= 255, VARCHAR (M): L + 1 bytes, L <= M and 0 <= M <= 65535, TINYTEXT, L + 1 byte, of which L <2 ^ 8
TEXT: L + 2 bytes, of which L <2 ^ 16, MEDIUMTEXT: L + 3 bytes, of which L <2 ^ 24, LONGTEXT: L + 4 bytes, L <2 ^ 32, ENUM ('value1', 'value2'): one or two bytes, depending on the number of enumeration types (up to 65535)
SET ('value1', 'value2'): 1, 2, 3, 4, or 8 bytes, depending on the number of set members (up to 64 ).