In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
MySQL uses many different data types, which are generally divided into three types: number, date, time, and string types. Here are the corresponding data types
1, numeric data type
INT-A normal-sized integer that can be signed. If it is signed, it allows a range from-2147483648 to 2147483647. If it is unsigned, the allowed range is from 0 to 4294967295. You can specify a width of up to 11 digits.
TINYINT-A very small integer that can be signed. If signed, the range it allows is from-128 to 127. If it is unsigned, the allowed range is from 0 to 255, and you can specify a width of up to 4 digits.
SMALLINT-A small integer that can be signed. If there is a symbol, the allowable range is-32768 to 32767. If unsigned, the allowed range is from 0 to 65535, and you can specify a width of up to 5 digits.
MEDIUMINT-A medium-sized integer that can be signed. If there is a symbol, the allowable range is-8388608 to 8388607. If unsigned, the allowed range is from 0 to 16777215, and you can specify a width of up to 9 bits.
BIGINT-A large integer that can be signed. If signed, the allowable range is-9223372036854775808 to 9223372036854775807. If unsigned, the range allowed is from 0 to 18446744073709551615. You can specify a width of up to 20 bits.
FLOAT (MMagar D)-unsigned floating-point numbers cannot be used. You can define the display length (M) and the number of decimal places (D). This is not required and defaults to 10 minute 2. Where 2 is the number of decimal places and 10 is the total number of numbers (including decimals). The precision of the decimal can reach 24 floating points.
DOUBLE (MMagar D)-unsigned double-precision floating-point numbers cannot be used. You can define the display length (M) and the number of decimal places (D). This is not required. The default is 16 ~ 4, where 4 is the number of decimal places. The decimal precision can reach 53 DOUBLE. REAL is synonymous with DOUBLE.
DECIMAL (MMagar D)-uncompressed floating point numbers cannot be unsigned. In unpacking decimals, each decimal corresponds to one byte. It is necessary to define the number of display lengths (M) and decimals (D). NUMERIC is synonymous with DECIMAL.
2, date and time type
DATE-date in YYYY-MM-DD format, between 1000-01-01 and 9999-12-31. For example, December 30th, 1973 will be stored as 1973-12-30.
DATETIME-the date and time combination is in YYYY-MM-DD HH:MM:SS format, between 1000-01-01 00:00:00 and 9999-12-31 23:59:59. For example, 3:30 on December 30, 1973, would be stored as 1973-12-30 15:30:00.
TIMESTAMP-time stamp between midnight on January 1st, 1970, to sometime in 2037. This looks like the previous DATETIME format and does not need to be just a hyphen between numbers; 03:30 in the afternoon of December 30, 1973 will be stored as 19731230153000 (YYYYMMDDHHMMSS).
TIME-Storage time is in HH:MM:SS format.
YEAR (M)-stores the year in a 2-digit or 4-digit format. If the length is specified as 2 (for example, YEAR (2)), the year can be from 1970 to 2069 (70 to 69). If the length is specified as 4, the year range is 1901-2155, and the default length is 4.
3, string type
CHAR (M)-A fixed-length string is between 1 and 255 characters in length (for example: CHAR (5)), storing the right space filled to the specified length. Limiting length is not required, it defaults to 1.
VARCHAR (M)-A variable-length string is between 1 and 255 characters in length (the higher version of MySQL is more than 255); for example: VARCHAR (25). When you create a VARCHAR type field, you must define the length.
The maximum length of a BLOB or TEXT-field is 65535 characters. BLOB is a "binary large object" and is used to store large binary data, such as images or other types of files. Defined as a TEXT text field, it also holds a large amount of data; the difference between the two is that the data stored in sorting and comparison is case-sensitive in BLOB, while TEXT fields are not case-sensitive. You do not need to specify the length of BLOB or TEXT.
TINYBLOB or TINYTEXT-BLOB or TEXT columns have a maximum length of 255characters. The length of TINYBLOB or TINYTEXT is not specified.
MEDIUMBLOB or MEDIUMTEXT-BLOB or TEXT columns have a maximum length of 16777215 characters. The length of MEDIUMBLOB or MEDIUMTEXT is not specified.
LONGBLOB or LONGTEXT-BLOB or TEXT columns have a maximum length of 4294967295 characters. The length of LONGBLOB or LONGTEXT is not specified.
ENUM-enumeration, which is a strange list of terms. When defining an ENUM, to create a list of its values, these are the items (which can also be NULL) that must be used for selection. For example, if you want the field to contain "A" or "B" or "C", you can define ENUM as ENUM ("A", "B", "C") and only these values (or NULL) can be used to populate this field.
Article from (www.huthon.com)
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.