MySQL integer type description int (5) vs Int (7)

Source: Internet
Author: User

It suddenly dawned on me today that 1 of the Int (1) and tinyint (1) in MySQL only specify the display length, not the storage length, only useful if the field specifies Zerofill. The limit of the digits is basically meaningless.

Int (5) Here 5 represents the shortest display of 5 characters. Int (7) Here 7 represents the shortest display of 7 characters. When the length of the inserted character exceeds (m), it is equivalent to nothing; when the character length is less than (m), it is necessary to specify a character to fill, such as zerofill (denoted with 0 padding).

such as int (5), insert data is 1234, if not filled 0, the display is 1234, fill 0, display is 01234

MySQL integer type description int (5) vs Int (7)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.