Value range of MySQL field

Source: Internet
Author: User

TINYINT

-128–127

TINYINT UNSIGNED

0–255

SMALLINT

-32768–32767

SMALLINT UNSIGNED

0–65535

Mediumint

-8388608–8388607

Mediumint UNSIGNED

0–16777215

INT or INTEGER

-2147483648–2147483647

INT UNSIGNED or INTEGER UNSIGNED

0–4294967295

BIGINT

-9223372036854775808–9223372036854775807

BIGINT UNSIGNED

0–18446744073709551615

FLOAT

-3.402823466e+38–-1.175494351e-38

0

1.175494351e-38–3.402823466e+38

Double or double PRECISION or real

-1.7976931348623157e+308–-2.2250738585072014e-308

0

2.2250738585072014e-308–1.7976931348623157e+308

decimal[(M,[d])] or NUMERIC (m,d)

Determined by M (the length of the entire number, including the decimal point, the number of digits to the left of the decimal point, the number of digits to the right of the decimal point but excluding the minus sign) and D (the number of digits to the right of the decimal point), the M defaults to 10,d default of 0

DATE

1000-01-01–9999-12-31

Datetime

1000-01-01 00:00:00–9999-12-31 23:59:59

TIMESTAMP

1970-01-01 00:00:00–2037 years of the day (specific is the day I do not know, hehe)

Time

-838:59:59′to 838:59:59

year[(2|4)]

The default is 4-bit format, and the 4-bit format takes a value range of 1901–2155,0000,2 bit format to 70-69 (1970-2069)

CHAR (M) [BINARY] or NCHAR (m) [BINARY]

The range of M is 1–255, and if there is no binary entry, the nchar is not case-sensitive, and the default character set is used. In the database, the space is made up, but the spaces at the end of the fetch are automatically removed.

[National] VARCHAR (M) [BINARY]

The range of M is 1–255. Spaces at the end of the database are automatically removed.

Tinyblob or Tinytext

255 (2^8-1) characters

BLOB or TEXT

65535 (2^16-1) characters

Mediumblob or Mediumtext

16777215 (2^24-1) characters

Longblob or Longtext

4294967295 (2^32-1) characters

ENUM (' value1′, ' value2′,...)

There can be a total of 65,535 different values

SET (' value1′, ' value2′,...)

Up to 64 members

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.