1. Insert Data Mode
a> INSERT into student (ID, name, age) VALUES (1, ' Zhangsan ', 3);
--The string type should be enclosed in double quotes or single quotes, otherwise the error
b> INSERT into student values (1, ' Zhangsan ', 3); --Omit specific fields, and the database internally matches according to the default order of the fields
2, select DISTINCT (select DISTINCT is a whole, distinct can only be placed in front of the first field, to the first column to go to Heavy)
Understanding: First identify the required fields, and then use distinct to remove the duplicate records (where the records refer to the query result fields), not the field
3, WHERE clause numeric type, recommended not quoted number (without quotation marks, instead of query time long??? The results of a large amount of data, but also need to verify, first record here)
Where clause without comparison operator (quoted in http://www.runoob.com/sql/sql-where.html, SQL in red box, validation unsuccessful, perhaps related to type or version of SQL software)
4, ORDER By default ascending ASC, desc Descending, can be multi-column sorting (text type whether English or Chinese are in 26 alphabetical order)
5, update use, to be cautious, as far as possible to modify a small number of lines, or even a row (plus where conditions, without conditions update all, previously used DB2 in the development of the project by mistake, the cost is heavy)
Can be set to modify the Safe mode, set sql_safe_updates = 1; can only be modified according to the primary key and verified correctly. Set to 0 to turn off Safe mode.
Safe Mode consciousness comes from (http://www.runoob.com/sql/sql-update.html):
Turn off Safe mode validation such as:
6, delete also need to use carefully
Note points such as: (Quoted http://www.runoob.com/sql/sql-delete.html)
MySQL Review Basics 2