MySQL----Basic data types

Source: Internet
Author: User

1, Numerical type:

Tinyint:1 bytes

Smallint:2 bytes

Mediumint:3 bytes

Int:4 bytes

Bigint:8 bytes

Float:4 bytes

Double:8 bytes

Decimal (M,c): M represents the total length of this fixed-point floating point data, because decimal is a large number of list implementations, so the actual size of decimal is m+2, which is used by the list header.

Bit (m): The number of M table bits (bit) its value is between [1,64], so the value range of M is between [1,8].

2. Time Type:

Date--------4 bytes--------1000/01/01--------9999/12/31

DateTime--------8 bytes--------1000/01/01 00:00:00--------9999/12/31 23:59:59

Timestamp--------4 bytes--------1970010180001--------2038

Time--------3-byte--------( -838:59:59)--------(838:59:59)

Year--------1 bytes-------1901--------2155

3. String type

char (m), varchar (m) #char (m) is a list of one-byte table headers so it has a value of 0-->255 (2 of the 8-square) varchar (m) is the most so largest of the double-byte 65535 (2 16-square).

Tinyblob, BLOBs, Mediumblob, longblob#, respectively, are 1, 2, 3, 4-byte headers.

Tinytext, text, Mediumtext, longtext#, respectively, are 1, 2, 3, 4-byte headers.

varbinary (m), binary (m) #这个已经是无发无天了 can be seen as large as you want.

  

MySQL----Basic data types

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.