In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you how to use mysql data types and field properties, the content is easy to understand, I hope you can learn, after learning there will be gains, the following let Xiaobian take you to take a look at it.
Data type:
The data type of mysql is the type of data that is stored.
Numeric type: integer type: tinyint,smallint,mediumint,integer,bigint is signed by default If you need to use unsigned data types, add "UNSIGNED" type abbreviated byte size (signed) range (unsigned) range Note Integer type: TINYINT10~255-128~127SMALLINT20~65535-32768~32767MEDIUMINT30~16777215-8388608~8388607INTEGERINT40~4294967295-2147483648~2147483647BIGINT80~264-1-263-1 decimal type: floating point type: float (size,d), double (size,d) size is the maximum number of digits of the number D is the number of digits to the right of the decimal point (even if you don't lose that many digits). The accuracy of FLOAT is 6 to 7 bits (depending on the situation? After all, the machine is stored in binary system), the precision of DOUBLE is 14-15 digits, the number of integer parts is SIZE-D, the number of values directly stored cannot be more than this, but if floating point rounding leads to integer rounding and overflow exceeds the maximum number, the system allows it (some versions do not seem to be allowed, so generally do not exceed decimal places). In many cases, it is not necessary to pay attention to the size of the numerical range of the two floating points (which is extremely large), the focus should be its accuracy.
Fixed point type: decimal (size,d) size is the maximum number of digits, the maximum is 65, d is the maximum number of digits to the right of the decimal point, the maximum is 30. The fixed point type does not allow the length of the integer part to be out of range because the decimal part is rounded. DECIMAL does not lose accuracy. It can be understood as using "string" storage (according to MYSQL's authoritative guide).
The directly unparenthesized data types float, double, and decimal represent date types without decimal parts:
Time and date types include date,time,datetime,timestamp,year
Datetime: time and date, in YYYY-MM-DD HH:II:SS format, range from 1000 to 9999 (some versions already allow 0-9999? Date: date, format is YYYY-MM-DD, the range is from 1000 to 9999 Time: time period, format is HH:II:SS, the specified time is between a certain interval, plus or minus. ] Year: year, indicating the range 1901-2156, there were originally two formats, year (2) and year (4), but year (2) was removed. String type: set: collection string. Put specific strings into the collection. After the collection is defined, you cannot insert a string other than the collection element. (multiple qualified strings can be inserted) the collection string is actually just a numeric value, and the system automatically converts it to the corresponding string.
Enum: enumerated strings are similar to set, but only one string can be inserted here (the value of a field of type set can be multiple set elements, but enum can only be one of them) enumerate the possible data, and the actual stored data can only be the enumerated data. The use of enumerations helps to unify data and save storage space (enumerations just store numeric values and the system converts to strings). Enumerated elements are actually labeled in the defined order, starting with 1, so you can directly insert values corresponding to enumerated elements.
Blob: binary data string storage binary data (rarely used) text: text string stores text, when the character is greater than 255, generally use text;varchar: variable length string varchar (L), L represents the character length, the unit is characters, the maximum length is 65536. In actual storage, 1 to 2 bytes are required to store the length (1 or 2 depends on the actual size, 216035536
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.