1. mysql data types include: integer type, floating-point type, fixed-point number type, date-time type, string type, binary type;
2, integer type denotes integers, floating-point numbers and fixed-points represent decimals, and datetime types represent time;
3. String type
Char: You need to specify a fixed length when creating, the value 0-255, each data must occupy a specified length of space, the advantage is the query data fast;
VARCHAR: You need to specify a fixed length when creating, the value 0-65535, if the specified varchar (100) length is 100, when a field length of only 27 o'clock, in the database of the field only 28 bytes (string actual length + 1), so that the system space can be saved;
Blob:
Text: Special string type, text can only hold character data, including Tinytext/text/mediumtext/longtext
Enum: Enum, controls the range of data inserted, can only select a value in the table, enumeration has 65,535
Set: Collection, select the data to be inserted from the specified collection, the collection can have 64 values
4. Binary type
Binary: You need to specify a fixed length at the time of creation, value 0-255
varbinary: You need to specify a fixed length when creating. By default 255, the actual space occupied by data storage is +1 of the actual length of the data.
Bit: You need to specify a fixed length when creating. Default 64
Tinyblob:
Blob: A special binary type for storing binary data with a large amount of data, used to store binary files such as pictures, PDF documents, and more.
Mediumblob:
Longblob
Problem: Floating point and fixed point number difference: A, when the inserted field is higher than their specified precision, will be rounded, but float at this time no error, fixed-point number will have a warning;
b, floating point precision and hardware equipment, system-related, fixed-point number default 10-bit integer;
C, fixed-point precision is higher than floating-point number, all if the data requirements are high, it is recommended to use fixed-point number.
The same point of datetime and timestamp: A, both represent the date and time,
Different points: A, DateTime represents a greater time range, B, timestamp display time according to time zone
Database-Data type