Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the value range of various fields in MySQL?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Xiaobian to share with you what the range of values of various fields in MySQL is, I believe most people still do not know how, so share this article for your reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!

[@more@]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)

by M(length of whole number, including decimal point, digits to the left of decimal point, digits to the right of decimal point, but excluding minus sign) and

D(the number of digits to the right of the decimal point),M defaults to 10,D defaults to 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 (I don't know exactly what day)

TIME

-838:59:59' to 838:59:59

YEAR[(2|4)]

Default is 4-bit format, 4-bit format values range from 1901 - 2155,0000, 2-bit format values range from 70-69(1970-2069)

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

M is in the range 1 - 255, case insensitive if there is no BINARY entry,NCHAR means using the default character set. the database

Space complement, but when taken out at the end of the space will be automatically removed.

[NATIONAL] VARCHAR(M) [BINARY]

M ranges from 1 - 255. trailing spaces in 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 65535 different values.

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

Up to 64 members

The above is "MySQL various field value range is what kind of" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report