MySQL Workbench – Understanding Datatype Parentheses Values

MySQLmysql-workbench

I create columns in MySQL Workbench and it often puts different numbers in parentheses after datatype, e.g. I input this:

Column Name          Datatype:
id                   INT
account_parameters   INT
accounts             TINYINT
account_properties   TINYINT

and after executing the query I get

Column Name          Datatype:
id                   INT(10)
account_parameters   INT(11)
accounts             TINYINT(1)
account_properties   TINYINT(2)

Why does it do it? Is there a reason why one should be INT(11), while others are INT(10)?

Best Answer

In this case, the difference is likely due to the int and tinyint being signed (default) or unsigned in their definitions. Note that the numbers in the parentheses are largely irrelevant for most applications (they define a display width).