From the course: MySQL Essential Training (2019)

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Numeric types

Numeric types

- [Instructor] MySQL's numeric types include types for integer, fixed point, and floating point real numbers. Integer types are used for storing numbers that do not have a fractional part. There are five integer types in MySQL, and they differ only in the scale of the values they can represent. This table shows the storage requirements and scale for the various integer types. Note that INT is an alias for INTEGER. So when you see INT or INTEGER, they mean exactly the same thing. The SQL standard is INTEGER, but MySQL, like most database systems, recognizes INT as exactly the same type. The decimal type is used for fixed precision values. The type declaration for DECIMAL takes two parameters. The first parameter is the precision. This specifies the number of digits that will be stored. This includes the digits after the decimal point. The second parameter is the scale, and this specifies the position of the decimal point. Zero means no decimal point. For example, this declaration has a…

Contents