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 are the MySQL field types

2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article is to share with you what MySQL field types are, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

MySQL supports a large number of column types, which can be divided into three types: numeric type, date and time type, and string (character) type. This section first gives an overview of the available types, summarizes the storage requirements for each column type, and then provides a more detailed description of the nature of the types in each class. The overview is deliberately simplified, and a more detailed description should take into account additional information about specific column types, such as the allowable format for which you can specify values.

The column types supported by MySQL are listed below. The following code letters are used in the description:

M

Indicate the maximum display size. The largest legal display size is 255.

D

Applies to floating-point types and indicates the number of digits that follow the decimal point. The maximum possible value is 30, but it should not be greater than MMel 2.

Square brackets ("[" and "]") indicate the portion of the optional type modifier.

Note that if you specify one as ZEROFILL,MySQL, the UNSIGNED property will be automatically added to the column.

TINYINT [(M)] [UNSIGNED] [ZEROFILL]

A very small integer. The signed range is-128 to 127 and the unsigned range is 0 to 255.

SMALLINT [(M)] [UNSIGNED] [ZEROFILL]

A small integer. The signed range is-32768 to 32767 and the unsigned range is 0 to 65535.

MEDIUMINT [(M)] [UNSIGNED] [ZEROFILL]

A medium-sized integer. The signed range is-8388608 to 8388607 and the unsigned range is 0 to 16777215.

INT [(M)] [UNSIGNED] [ZEROFILL]

A normal size integer. The signed range is-2147483648 to 2147483647 and the unsigned range is 0 to 4294967295.

INTEGER [(M)] [UNSIGNED] [ZEROFILL]

This is a synonym for INT.

BIGINT [(M)] [UNSIGNED] [ZEROFILL]

A large integer. The signed range is-9223372036854775808 to 9223372036854775807, and the unsigned range is 0 to

18446744073709551615 . Note that all arithmetic operations are done with signed BIGINT or double values, so you should not use signed large integers greater than 9223372036854775807 (63 bits), except for bit functions! Note that when the two parameters are integer values, -, +, and * use the BIGINT operation! This means that if you multiply by two large integers (or from a function that returns an integer), if the result is greater than 9223372036854775807, you can get unexpected results. A floating-point number cannot be unsigned. For a single-precision floating-point number, the precision can be

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