MySQL Data Type

Source: Internet
Author: User

MySQL Data Type
Text

CHAR (*): a fixed-length string of up to 255 bytes. Its length must be specified at creation.

VARCHAR (*): a variable-length string of up to 255 bytes. Its length must be specified at creation.

TEXT: variable-length TEXT with a maximum length of 64 k characters

TINYTEXT: variable-length text up to 255 characters

MEDUIMTEXT: variable-length text with a maximum length of 16 k characters

LONGTEXT: variable-length text with a maximum length of 4 GB

 

INTEGER (select the smallest possible type after considering the data value)

 

Tinyint: 1 byte. Signed value:-128 to 127; unsigned value: 0 to 255

Smallint: 1 byte. Signed value:-32768 to 32767; unsigned value: 0 to 65535

Mediumint: 3 bytes.

Int: 4 bytes

Bigint: 8 bytes

 

Decimal places (length and decimal places are required, that is, the display width and decimal places)

 

Decimal: Precisely stores decimals. It is internally stored using strings. It is suitable for exact types such as amount. Alias: NUMERIC

Float: 4 bytes, single precision. Approximate storage (*), which is more efficient than decimal.

Double: 8 bytes, double precision. Approximate storage (*), which is more efficient than decimal.

 

Date and Time

DATE: 4 bytes. Range: 1000-01-01--9999-12-31

TIME: 3 bytes. Range:-838: 59: 59--838: 59: 59

DATETIME: 8 bytes. Value Range: 1000-01-01 00:00:00 -- 9999-12-31 23:59:59

 

 

Binary Big Data

TITYBLOB: the maximum length is 255 bytes.

BLOB: the maximum length is 64 KB.

MEDIUMBLOB: the maximum length is 16 MB.

LONGBLOB: the maximum length is 4 GB.

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.