Difference between “int” and “int(2)” data types in my sql

前端 未结 4 2229
没有蜡笔的小新
没有蜡笔的小新 2020-12-08 02:16

Just I wonder why the range is given with the my sql data types. I define a table with a field name \"id\" and the data type is \"int(2)\". I inserted the value to the field

4条回答
  •  萌比男神i
    2020-12-08 02:55

    The (2) doesn't define the size of the integer. It's just number of digits to display in some tools - I'm not sure of the details. The size of an integer is determined by whether it's INT, TINYINT, SMALLINT, MEDIUMINT, or BIGINT.

提交回复
热议问题