MySQL tinyint smallint mediumint int bigint

Source: Internet
Author: User

Type

Space occupied by storage

(no matter how many bits are displayed)

(Unit byte/bytes)

Storing data ranges Maximum display length
tinyint 1

-128 ~ 127 Signed

0 ~ 255 Unsigned

3  

Smaillint 2

-32768 ~ 32767 Signed

0 ~ 65535 unsigned

5
Mediumint 3

-8388608 ~ 8388607 Signed

0 ~ 16777215 Unsigned

7 signed

8 unsigned

Int 4

-2147483648 ~ 2147483647 Signed

0 ~ 4294967295 Unsigned

11
bigint 8

-9223372036854775808 ~ 9223372036854775807 Signed

0 ~ 18446744073709551615 Unsigned

Signed

Unsigned

Create   TableMysql_int (IDint( One)Primary Keyauto_increment,tinyint_atinyint(3) not NULL, Smallint_bsmallintUnsigned not NULL, Mediumint_c mediumint (7) not NULL, Bigint_dbigintUnsigned not NULL);

 

MySQL tinyint smallint mediumint int 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.