MYSQL Numeric Data types

Data types define the nature of the data that can be stored in a particular column of a table

MySQL has 3 main categories of data types namely

  • Numeric,
  • Text
  • Date/time.

Numeric Data types

Numeric data types are used to store numeric values. It is very important to make sure range of your data is between lower and upper boundaries of numeric data types.

TINYINT( ) -128 to 127 normal 0 to 255 UNSIGNED.

SMALLINT( ) -32768 to 32767 normal 0 to 65535 UNSIGNED.

MEDIUMINT( ) -8388608 to 8388607 normal 0 to 16777215 UNSIGNED.

INT( ) -2147483648 to 2147483647 normal  0 to 4294967295 UNSIGNED.

BIGINT( ) -9223372036854775808 to 9223372036854775807 normal 0 to 18446744073709551615 UNSIGNED.

FLOAT A small approximate number with a floating decimal point.

DOUBLE( , ) A large number with a floating decimal point.

DECIMAL( , ) A DOUBLE stored as a string , allowing for a fixed decimal point. Choice for storing currency values.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *