In general, MySQL is more interesting than I think (it can even be used as a calculator). Now I will summarize my experience over the past half month, I hope to share it with you.
Interesting 1. MySQL internally stores the decimal data type as a string. Oh! Store the value type as a string (of course, MySQL does this because it wants to provide services in the most accurate way ).
Interesting 2. Differences between the char type and the varchar type. The difference between them is only in the way of processing parameters in parentheses. Char regards this size as the exact size of the value (fill in the short information with spaces, so this effect is achieved ); varchar regards it as the maximum data size, and only uses the number of bytes actually required for the storage string ).
Interesting 3. MySQL does not let go of any illegal data. Even if you want to insert '2017-02-29 'into a data type field, it will be rejected.
Interesting aspect 4. "<>" operator. Maybe you can't imagine it before you get into mysql. It turns out to be a non-equal sign in MySQL, which is quite interesting and has a very personalized non-equal sign.
Quest 5. Select 'hero' = 'hero'; the result is 1. The return value of select 'hero' = 'hero' is 0. This is because MySQL ignores the spaces behind the string, while the spaces above are retained. (Note the space position in SQL statements)
Qudian 6, select 6 = NULL; and select 88 <> NULL; the corresponding results are null. This is because a comparison operation that includes a null value usually produces a null value.
Interesting points 7. "<=>" operator. It is also a more personalized operator. MySQL Manual calls it "null secure" equal to the operator.
Qu Dian 8. Select "" is null; the result is 0. MySQL makes a clear distinction between null and null values.