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

Definition and summary of Mysql data types

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

Share

Shulou(Shulou.com)06/01 Report--

The following content mainly brings Mysql data type definition and summary to everyone. The knowledge mentioned here is slightly different from books. It is summarized by professional technicians in the process of contacting users. It has certain experience sharing value and hopes to bring help to readers.

Before we get into data storage, let's take a look at mysql's data types. What is the data type? Data types refer to columns; data characteristics of parameters, expressions, and local variables in stored procedures, which determine how data is stored and represent different types of information. (Recommended course: MySQL tutorial)

Integer:

Integers often refer to integers, but they can be subdivided into five types: TINYNIT,SMALLINT,MEDIUMINT,INT, and BIGINT.

Type storage range bytes TINYINT signed values: -128 to 127 (-2^7 to 2^7-1)

unsigned values: 0 to 255 (0 to 2^8-1) 1SMALLINT signed values: -32768 to 32767 (-2^15 to 2^15-1)

unsigned values: 0 to 65535 (0 to 2^16-1) 2MEDIUMINT signed values: -8388608 to 8388607 (-2^23 to 2^23-1)

unsigned values: 0 to 16777215 (2^24-1) 3INT signed values: -2147483648 to 2147483647 (-2^31 to 2^31-1)

unsigned values: 0 to 4294967295 (2^32-1) 4BIGINT signed values: -9223372036854775808 to 9223372036854775807 (-2^63 to 2^63-1)

Unsigned values: 0 to 18446744073709551615 (2^64-1) 8

floating point number

Floating-point numbers often refer to numbers with decimals. Floating-point numbers are divided into two types: FLOAT single-precision floating-point numbers and DOUBLE double-precision floating-point numbers. Double-precision floating-point numbers are ten times more accurate than single-precision floating-point numbers, but they use more memory.

Type Storage Range FLOAT[(M,D)]

-3.402823466E+38 to-1.175494351E-38, 0 and 1.175494351E-38 to 3.402823466E +38

M indicates the total number of digits and D indicates the number of digits after the decimal point. If M and D are omitted, the values are saved according to the hardware allowed limits. Single-precision floating-point numbers are accurate to approximately 7 decimal places.

DOUBLE

-1.7976931348623157E+308 to-2.2250738585072014E-308, 0 and 2.2250738585072014E-308 to 1.7976931348623157E +308

M indicates the total number of digits and D indicates the number of digits after the decimal point. If M and D are omitted, the values are saved according to the hardware allowed limits. Single-precision floating-point numbers are accurate to approximately 7 decimal places.

character type

Character type is a type we use very often, such as string. Character types have eight types.

Type Storage Range CHAR(M)M bytes, where M is 0

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: 283

*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