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--
This article will explain in detail what data types there are in mysql. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Mysql data types are: 1, numeric type; 2, date and time type; 3, string type is CHAR, VARCHAR, BINARY [binary data type], BLOB, TEXT [text type], ENUM [enumerated type] and SET [data collection].
The mysql data types are:
MySQL supports several data types: numeric type, date and time type, and string (character) type.
Data type:
Note:
We often use num int (10) unsigned in defining a field, where int (10) does not mean that the field will store 10 numbers in length.
Int (M) represents the format of the digital display and is valid only if the field property is set to zerofill.
Eg:
Tinyint (4)-the actual stored value is 2. If zerofill is not specified, the result of the query is 2. If zerofill is specified, the query result is 0002. Fill it with 0 on the left.
Zerofill attribute:
If the field specifies a zerofill attribute, mysql automatically adds a UNSIGNED attribute to the field.
The ZEROFILL attribute is ignored when it comes to column expressions or UNION queries
Floating point type:
Float (M ~ D): M is the number of digits of a number, including the integer part and the decimal part D is the fractional part, [D INSERT INTO t (numbers) VALUES (2), ('2'), ('3'); mysql > SELECT * FROM t +-+ | numbers | +-+ | 1 | | 2 | | 2 | +-+ SET: set is an object that can have a string of zero or more values, each of which must select from the list the value specified when the table is allowed to be created. [when the inserted value does not match the value of the list by row, MYSQL ignores values that do not exist in the list]
1 CREATE TABLE myset (col SET ('arecy,' baked, 'caged,' d')); 23 INSERT INTO myset (col) VALUES ('arecalogical d'), (' drecery a'), ('arecalogical d'), (' arecalogical d'), ('dparting d'), (' ddjinajd'); it can be seen from the definition that the difference between ENUM and SET lies in whether the value is one or more of the values specified at the time of definition. Also, the behavior of inserting values that do not exist in the list is different.
About what data types in mysql to share here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.