# Integer Data Types
+ Data Type:
  + `TINYINT`
  + `SMALLINT`
  + `MEDIUMINT`
  + `INT, INTEGER`
  + `BIGINT`
+ Attributes:
  + `UNSIGNED`: Negative numbers are not allowed

__*Comparing Integer Data Types*__

![right](./student-guide/diagram/numeric-int-compare-table.png)

------------------------------------------------------------
TiDB supports all integer types in MySQL, including INTEGER/INT, TINYINT, SMALLINT, MEDIUMINT, and BIGINT

Notes: TiDB supports an extension for optionally specifying the display width of integer data types in parentheses following the base keyword for the type. For example, INT(7) specifies an INT with a display width of 7 digits. This optional display width may be used by applications to display integer values having a width less than the width specified for the column by left-padding them with spaces. The display width does not constrain the range of values that can be stored in the column. Nor does it prevent values wider than the column display width from being displayed correctly.

- TINYINT type. The range for signed numbers is [-128, 127]. The range for unsigned numbers is [0, 255].
  - `TINYINT[(M)] [UNSIGNED] [ZEROFILL]` 

- Smallint type. The range for signed numbers is [-32768, 32767]. The range of unsigned numbers is [0, 65535]
  - `SMALLINT[(M)] [UNSIGNED] [ZEROFILL]` 

- MEDIUMINT type. The range for signed numbers is [-8388608, 8388607]. The range for unsigned numbers is [0, 16777215].
  - `MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]` 

- INTEGER type, alias INT. The range of signed numbers is [-2147483648, 2147483647]. The range for unsigned numbers is [0, 4294967295].
  - `INT[(M)] [UNSIGNED] [ZEROFILL] or INTEGER[(M)] [UNSIGNED] [ZEROFILL]` 

- BIGINT type. The range of signed numbers is [-9223372036854775808, 9223372036854775807]. The range for unsigned numbers is [0, 18446744073709551615].
  - `BIGINT[(M)] [UNSIGNED] [ZEROFILL]` 


