Search code examples
mysqlsqldatatypes

What is the meaning of different integer mysql types


What is the difference between, for example, TINYINT and INT(1) or between TINYINT(3) and MEDIUMINT?


Solution

  • The difference is the storage.

    TINYINT is a 1 byte. MEDIUMINT is 3 bytes. INT is 4 bytes. TINYINT(3) 3 here is the display width. Display width is unrelated to the range of values a type can contain.

    So TINYINT and TINYINT(3) takes the same storage, but presentation is different.