

MySQL supports both of these variant forms of DECIMAL syntax. Similarly, the syntax DECIMAL is equivalent to DECIMAL( M,0). The syntax DECIMAL( M) is equivalent to DECIMAL( M,0). Therefore the value range will be from -999.99 to 999.99. ) be able to store any value with five digits and two decimals. In standard SQL the syntax DECIMAL(5,2) (where 5 is the precision and 2 is the scale.

MySQL 5.6 stores DECIMAL values in binary format. In MySQL DECIMAL and NUMERIC types store exact numeric data values. Following table shows the required storage and range (maximum and minimum value for signed and unsigned integer) for each integer type.įixed-Point data types are used to preserve exact precision, for example with currency data. As an extension to the standard, MySQL also supports the integer types TINYINT, MEDIUMINT, and BIGINT. SQL standard integer types INTEGER (or INT) and SMALLINT are supported by MySQL. The BIT data type stores bit-field values and is supported for MyISAM, MEMORY, InnoDB, and NDB tables. REAL is a synonym for DOUBLE PRECISION (a nonstandard variation) unless the REAL_AS_FLOAT SQL mode is enabled. DOUBLE is a synonym for DOUBLE PRECISION (a nonstandard extension). The keyword INT is a synonym for INTEGER, and the keywords DEC and FIXED are synonyms for DECIMAL. It also supports the approximate numeric data types (FLOAT, REAL, and DOUBLE PRECISION). MySQL supports all standard SQL numeric data types which include INTEGER, SMALLINT, DECIMAL, and NUMERIC. Data types are discussed on this page are based on MySQL community server 5.6 MySQL has Numeric Types, the DATETIME, DATE, and TIMESTAMP Types and String Types.

MySQL supports a number of SQL standard data types in various categories. A data type also specifies the possible values for that type, the operations that can be performed on that type and the way the values of that type are stored. A data type specifies a particular type of data, such as integer, floating-point, Boolean etc.Ģ.
