- MySQL data types describe numeric types (integer type tinyint,smallint,mediumint,int,bigint; floating point decimal data type float and double, fixed-point decimal type Decimal), Date/Time type (year, Time,date,datetime,timestamp) and String types (Char,varchar,binary,varbinary,blob,text,enum,set), string types are also divided into text strings and binary strings.
- Integer type, you can add a auto_increment self-increment constraint condition. , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp &NBSP , &NB Sp
The number in parentheses after the data type when the table is created refers to the width of the change display, with the default display width for each type of integer, and the default width to show the maximum data that the data type can represent. The default width is as shown. , &NB Sp , &NB Sp , &NB Sp
- floating-point types and fixed-point number types, float types have single-precision floating-point types and double-precision floating-point types. Fixed-point types have only one decimal type. In M,n, M is precision, representing the total number of digits, n is the scale, the number of decimal places , &N Bsp , &NB Sp
D The storage space of the ecimal is determined by the precision value M. float and double do not specify precision, the default is based on the actual precision (determined by the computer hardware and the operating system), decimal without specifying precision, default to (10,0)
- Date and time date and time type, format and range as shown &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &N Bsp
Text string type, support text string and binary string, where text string type such as &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp
Binary string, mainly with the following binary data types. , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp &NBSP , &NB Sp
- How to choose the data type to ensure that the normal situation, the smaller the space, the better.
- Common operators describe arithmetic operators, comparison operators, logical operators, bit operators.
- Arithmetic operators plus + minus-multiply * divide/seek redundancy or call modulo operator%.
- Comparison operator comparison operator as shown: &NBS P , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp
where = equals and <=> security equals the difference is security equals can be compared to null
- The logical operator results are true,false or null 1 to true,0 to false and null. : nbsp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp
Bitwise operators to test, shift, or test the bits in the binary byte. As shown in: , &N Bsp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp &NBsp
Operator precedence as shown in: &NBSP ; , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp /   , &NB Sp , &NB Sp
Data types and operators MySQL learning notes