DavidSzczesniak
1/22/2018 - 1:56 PM

Other integer types

There are alternatives to the INT keyword, depending on what value is being stored.

\!h BOOLEAN 
A type that stores a boolean value of false or true. It has the synonyms BOOL and BIT.

\!h TINYINT[(width)] [UNSIGNED] [ZEROFILL]
Stores whole number(integer) values in the range -128 to 127. 
Using UNSIGNED, a column can store values in the range 0 to 255.
Requires one byte of storage.

\!h SMALLINT[(width)] [UNSIGNED] [ZEROFILL] 
Stores whole number(integer) values in the range -32,768 to 32,767. 
Using UNSIGNED, a column can store values in the range 0 to 65,535.
Requires two bytes of storage.

\!h MEDIUMINT[(width)] [UNSIGNED] [ZEROFILL] 
Stores whole number(integer) values in the range -8,388,608 to 8,388,607. 
Using UNSIGNED, a column can store values in the range 0 to 16,777,215.
Requires three bytes of storage.

\!h BIGINT[(width)] [UNSIGNED] [ZEROFILL]
Stores whole number(integer) values in the range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
Using UNSIGNED, a column can store values in the range 0 to 18,446,744,073,709,551,615.
Requires eight bytes of storage.