Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/46559861
Integer data types in MySQL can specify the display width
Create a table
CREATE TABLE tb_emp (id BIGINT (1))
The ID field has a data type of bigint (1), noting the subsequent number 1, which represents the display width specified by the data type, specifying the number of digits in the numeric value that can be displayed.
For example, suppose you declare a field of type int of year int (4), which indicates that the data in the year field generally shows only the width of a 4-digit number.
The display width and the value range of the data type are irrelevant. The display width only indicates the maximum number of digits that MySQL can display, if the number of digits is less than the specified width, and if a value greater than the display width is inserted, as long as the value does not exceed the range of values for that type of integer, the values can still be inserted and displayed.
For example, to insert a numeric value of 19999 into the year field, when using a select query, MySQL will display a full 5-digit 19999 instead of a 4-bit number
If you do not specify a display width, mysql specifies a default width value for each type
Note: The display width is for display only and cannot limit the range of values and footprint, for example: Int (3) consumes 4 bytes of storage, and the maximum allowable value is not 999, but the maximum allowed for int integer.
MySQL optimization--Data type width