Length of int bigint smallint and tinyint in mysql

Source: Internet
Author: User


The length of int bigint smallint and tinyint in mysql int www.2cto.com int from-2 ^ 31 (-2,147,483,648) to 2 ^ 31-1 (2,147,483,647) integer data (all numbers ), the storage size is 4 bytes, And the SQL-92 of the int Is integer. If the unsigned attribute (unsigned => positive number) is selected, it is a 10-bit integer data of 2 ^ 31*2 + 1 (2147483647*2 + 1 = 4294967295, the storage size is 4 bytes. Mediumint if the unsigned (unsigned => positive) attribute is selected, it is (8388607*2 + 1 = 16777215) 8-bit integer data, and the storage size is 2 bytes. Smallint is an integer from-2 ^ 15 (-32,768) to 2 ^ 15-1 (32,767). The storage size is 2 bytes. If the unsigned attribute (unsigned => positive number) is selected, it is 2 ^ 15*2 + 1 (32767*2 + 1 = 65535) 6-bit integer data, the storage size is 2 bytes. Integer Data of tinyint from 0 to 255. The storage size is 1 byte.
 

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.