faster than string operations. Short strings run faster than long strings, and consume less disk. The fixed length type has better performance than the variable length type.What kind of comparison do you want? Strings can be case-sensitive or case-insensitive. The selection also affects sorting because it is based on comparison.Are you planning to index columns? If you plan to index a column, your selection of the
In mysql, null, not null, default, and auto_increment are common content. Here I will detail the usage of null, not null, default, and auto_increment in msyql.
NULL and not null modifie
group by phone;+ ----------------- + ---------- +| Phone | count (1) |+ ----------------- + ---------- +| NULL | 70 || 40 || + 86-13390889711 | 1 || + 86-13405053385 | 1 |
In step 1, 70 null data records and 40 null data records are found in the database.
Step 2:
Mysql> select count (1) from User where phone is
Label:Believe that a lot of people who have been using MySQL for a long time, the concept of these two field properties is not very clear, the general will have the following questions:
My field type is not NULL, why can I insert a null value
is less efficient than null for a gross NOT
Believe that a lot of people who have been using MySQL for a long time, the concept of these two field properties is not very clear, the general will have the following questions:1, my field type is not NULL, why I can insert null value2, the efficiency of the wool NOT NULL is higher than null3, when the judgment field
Believe that a lot of people who have been using MySQL for a long time, the concept of these two field properties is not very clear, the general will have the following questions:1, my field type is not NULL, why I can insert null value2, the efficiency of the wool NOT NULL is higher than null3, when the judgment field
Before adding a column, mysql checks whether bitsCN.com exists in the column.
Mysql checks whether the column exists before adding a column
Mysql does not have a direct syntax to d
default character set utf8; // modify the character set of the table. If you want to change the default character set and all character columns (CHAR, VARCHAR, TEXT) of the table to the new character set, use the following statement: alter table tbl_name convert to character set charset_name; warning: the previous operation converted the column type between CHARACTER sets. If one
NULL and NOT NULL modifiers:
You can add this null or NOT NULL modifier to each field to specify whether the field can be empty (null), or you must fill in the data (not NULL). mysql s
In MySQL, each field definition contains additional constraints or modifiers that can be used to increase the constraints on the input data. Today, let's take a look at MySQL field constraints:NULLAndNot NULLmodifiers,DEFAULTModifier,auto_incrementModifier.null and NOT NULL modifiers: You can add this null or NOT
Believe that a lot of people who have been using MySQL for a long time, the concept of these two field properties is not very clear, the general will have the following questions:1, my field type is not NULL, why I can insert null value2, the efficiency of the wool NOT NULL is higher than null3, when the judgment field
Tags: style http color using IO strong for AR dataAbout MySQLMySQL is an open source small relational database management system, the developer of the Swedish MySQL AB company. MySQL is widely used in small and medium-sized websites on the internet. Because of its small size, fast speed, low total cost of ownership, especially the open source, many small and medium-sized web sites in order to reduce the tot
Precautions for using the AUTO_INCREMENT column in MySQL: update auto-incrementing Column1. Description
(1) For the MyISAM table, if you use UPDATE to UPDATE the auto-incrementing column, if the column value is the same as the existing value, an error occurs. If the column v
Explicit_defaults_for_timestampMySQL5.6 Version IntroductionExplicit_defaults_for_timestampto control the timestamp NULL handling of Values timestamp not NULL insert null value, no error, no warning if the my.cnf Zhong Explicit_defaults_for_timestamp =1The value will be inserted when the error indicates that the colum
, the Generated Column type is not specified. The default value is Virtual Column. In addition:Stored Generated Column has poor performance.If Stored Generated Golumn is required, it is more appropriate to create an index on the Generated Column. For details, see section 4th.
In summary, generally, Virtual Generated
comparer is also represented by range:mysql> explain select * from a where a_id in (1,3,4) \g...Type:range...`ref (Reference)Non-unique index access list: Create Table A (a_id int not NULL, key (A_ID)); insert into a values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); Mysql> Explain select * from a where a_id=1\g...Type:ref ...Eq_ref (equivalent reference)Use a unique index lookup (primary key or uni
; ), -> PARTITION p2 VALUES LESS THAN MAXVALUE ( -> SUBPARTITION s2a, -> SUBPARTITION s2b -> ) -> );Query OK, 0 rows affected (0.04 sec)
In future, when the number of purchases for the decade beginning with the year 2000 grows to a point where the default location no longer provides sufficient space, the corresponding rows can be moved using an alter table... reorganize partition stat
If you want to add a column to a table that has already been built, you can use the following code:Alter TableTable nameAdd columnColumn Namevarchar( -) not NULLThis statement adds a column to an existing table in the last column of the table. If we want to add a column in the specified, you can use:Alter TableTable na
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.