MySQL integer Types (Exact Value)-Integer, INT, SMALLINT, TINYINT, Mediumint, BIGINT

Source: Internet
Author: User

When using MySQL, there are many types of int that need to be noted:

1. Range of values

( ( ) (
Type Storage Minimum Value Maximum Value
Bytes)signed/unsignedsigned/unsigned)
TINYINT 1 -128 127
0 255
SMALLINT 2 -32768 32767
0 65535
MEDIUMINT 3 -8388608 8388607
0 16777215
INT 4 -2147483648 2147483647
0 4294967295
BIGINT 8 -9223372036854775808 9223372036854775807
0 18446744073709551615

2. Display width

MySQL also supports the selection of the display width of the specified integer value within the parentheses following the type keyword.

Int (m) in the integer data type, m represents the maximum display width, and the optional display width specifies that the width is filled from the left when the value of the width less than the specified column width is displayed.

Reference documents:

Https://dev.mysql.com/doc/refman/5.5/en/integer-types.html

MySQL integer Types (Exact Value)-Integer, INT, SMALLINT, TINYINT, Mediumint, BIGINT

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.