11.1 Numeric Data Types数字数据类型

11.1.1 Numeric Data Type Syntax数字数据类型语法
11.1.2 Integer Types (Exact Value)整数类型(精确值) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT
11.1.3 Fixed-Point Types (Exact Value)定点类型(精确值) - DECIMAL, NUMERIC
11.1.4 Floating-Point Types (Approximate Value)浮点类型(近似值) - FLOAT, DOUBLE
11.1.5 Bit-Value Type位值类型 - BIT
11.1.6 Numeric Type Attributes数字类型属性
11.1.7 Out-of-Range and Overflow Handling超出范围和溢出处理

MySQL supports all standard SQL numeric data types. MySQL支持所有标准的SQL数字数据类型。These types include the exact numeric data types (INTEGER, SMALLINT, DECIMAL, and NUMERIC), as well as the approximate numeric data types (FLOAT, REAL, and DOUBLE PRECISION). 这些类型包括精确的数字数据类型(INTEGERSMALLINTDECIMALnumeric)以及近似的数字数据类型(FLOATREALDOUBLE PRECISION)。The keyword INT is a synonym for INTEGER, and the keywords DEC and FIXED are synonyms for DECIMAL. 关键字INTINTEGER的同义词,关键字DECFIXEDDECIMAL的同义词。MySQL treats DOUBLE as a synonym for DOUBLE PRECISION (a nonstandard extension). MySQL将DOUBLE视为DOUBLE PRECISION(非标准扩展)的同义词。MySQL also treats REAL as a synonym for DOUBLE PRECISION (a nonstandard variation), unless the REAL_AS_FLOAT SQL mode is enabled.MySQL还将REAL视为DOUBLE PRECISION(非标准变体)的同义词,除非启用了REAL_AS_FLOATSQL模式。

The BIT data type stores bit values and is supported for MyISAM, MEMORY, InnoDB, and NDB tables.BIT数据类型存储位值,MyISAMMEMORYInnoDB和NDB表支持NDB数据类型。

For information about how MySQL handles assignment of out-of-range values to columns and overflow during expression evaluation, see Section 11.1.7, “Out-of-Range and Overflow Handling”.有关MySQL在表达式求值期间如何处理对列的越界值赋值和溢出的信息,请参阅第11.1.7节,“超出范围和溢出处理”

For information about storage requirements of the numeric data types, see Section 11.7, “Data Type Storage Requirements”.有关数字数据类型的存储要求的信息,请参阅第11.7节,“数据类型存储要求”

For descriptions of functions that operate on numeric values, see Section 12.6, “Numeric Functions and Operators”. 有关对数值进行操作的函数的说明,请参阅第12.6节,“数值函数和运算符”The data type used for the result of a calculation on numeric operands depends on the types of the operands and the operations performed on them. 用于数值操作数计算结果的数据类型取决于操作数的类型及其执行的操作。For more information, see Section 12.6.1, “Arithmetic Operators”.有关详细信息,请参阅第12.6.1节,“算术运算符”

11.1.1 Numeric Data Type Syntax
11.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT
11.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC
11.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE
11.1.5 Bit-Value Type - BIT
11.1.6 Numeric Type Attributes
11.1.7 Out-of-Range and Overflow Handling