In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces which five types of MySQL data types, the article is very detailed, has a certain reference value, interested friends must read it!
1. The data type of MySQL
It mainly includes the following five categories:
Integer types: BIT, BOOL, TINY INT, SMALL INT, MEDIUM INT, INT, BIG INT
Floating point type: FLOAT, DOUBLE, DECIMAL
String types: CHAR, VARCHAR, TINY TEXT, TEXT, MEDIUM TEXT, LONGTEXT, TINY BLOB, BLOB, MEDIUM BLOB, LONG BLOB
Date type: Date, DateTime, TimeStamp, Time, Year
Other data types: BINARY, VARBINARY, ENUM, SET, Geometry, Point, MultiPoint, LineString, MultiLineString, Polygon, GeometryCollection, etc.
1. Integer
MySQL data type meaning (signed) tinyint (m) 1 byte range (- 128 '127) smallint (m) 2 byte range (- 32768' 32767) mediumint (m) 3 byte range (- 8388608 '8388607) int (m) 4 byte range (- 2147483648' 2147483647) bigint (m) 8 byte range (+-9.22'10 to the power of 18)
If the value range is added with unsigned, the maximum value is doubled, for example, the value range of tinyint unsigned is (0,256).
The m in int (m) represents the display width of the SELECT query result set, does not affect the actual range of values, does not affect the display width, I do not know what the use of this m.
2. Floating point type (float and double)
MySQL data type meaning float (m) single precision floating point precision (4 bytes) m total number, d decimal places double (m gravity d) double precision floating point precision (8 bytes) m total number, d decimal places
Let a field be defined as float (6p3). If you insert a number of 123.45678, what is actually stored in the database is 123.457, but the total number is still based on the actual number, that is, 6 digits. The maximum integer part is 3 digits, if the insertion number is 12.123456, the storage is 12.1234, and if the insertion is 12.12, the storage is 12.1200.
3. Fixed point number
Floating-point types store approximate values in the database, while fixed-point types store exact values in the database.
Decimal (m _ m _ d) parameter m
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.