Jump to: navigation, search

MySQL Numeric Data Types

From w3cyberlearnings
# Type Storage (Bytes) Range (Signed/Default) Range(Unsigned) Attribute Default Value
1 TINYINT 1 From -128 to 127 From 0 to 255 AUTO_INCREMENT, ZEROFILL,UNSIGNED NULL, NOT NULL
2 SMALLINT 2 From -32768 to 32767 From 0 to 65535 AUTO_INCREMENT, ZEROFILL, UNSIGNED NULL, NOT NULL
3 INT 4 From -2147483648 to 2147483647 From 0 to 4294967295 AUTO_INCREMENT, ZEROFILL, UNSIGNED, SERIAL DEFAULT VALUE NULL, NOT NULL
4 BIGINT 8 FROM -9223372036854775808 to 9223372036854775807 FROM 0 to 18446744073709551615 AUTO_INCREMENT, ZEROFILL, UNSIGNED, SERIAL DEFAULT VALUE NULL, NOT NULL
5 MEDIUMINT 3 FROM -8388608 to 8388607 FROM 0 to 16777215 AUTO_INCREMENT, ZEROFILL, UNSIGNED, SERIAL DEFAULT VALUE NULL, NOT NULL
6 FLOAT(P) 4 A precision from 0 to 23 results with a floating decimal point for single precision. (Not signed or unsigned) UNSIGNED, ZEROFILL NULL, NOT NULL
7 DOUBLE 8 A large number with a floating decimal point for double precision.(double is just like float, but double is twice the float) UNSIGNED, ZEROFILL NULL, NOT NULL
7 DECIMAL(D,M) 8 D is precision and M is scale. (NUMBERIC is the same as DECIMAL), and it is used for monetary data. It is between the double and float number to store extact numerical data values.(mainly for monetary data)A large number with a floating decimal point for double precision.(double is just like float, but double is twice the float) UNSIGNED, ZEROFILL NULL, NOT NULL
8 BIT(M) M is the range from 1 to 64 Is a binary notion.


Related Links

Navigation
Web
SQL
MISC
References