Dml:
The statement that adds SQL data to the table is the insert
INSERT into < table name > (column name) values (value list)/increase the properties of the corresponding column
Mull and null values are different in the database
Insert into table name (column name) Select to table column from to table name/copy data
Update table name set Column A = new column A where filter condition/change existing data
If you want to delete data, simply put the value to null
Ignoring where will change all the values of column A in the table
Delete from table name where filter condition/delete row of data or multiple rows
TRUNCATE TABLE name/delete all data directly and cannot be restored
Simple data query (DQL)
All values and null additions in MySQL are null
Projection operation: Select column A from table name
Table prefix name: Select P.name from table name as P
Column Aliases: Select Column A as a from table name as T
Pagination Processing:
Select column A from table name limit start sequence number to return the number of rows that need to be displayed
Where the limit in MySQL represents where the fixed number of rows starts to appear
Draining duplicate data: SELECT DISTINCT column A from table name
Select action:
Select Column name from table name where condition (single condition)
Select column A, column B from table name where condition A and condition B (multi-condition)
Computed columns:
Select column A + column B from table name
Select action:
SELECT * FROM table name where column a=100 is executed when column a=100 is true
Fuzzy query (like):
SELECT * FROM table name where column A like ' condition '
% denotes wildcard character (contains 0 or more characters)
_ indicates that only a single character can be used
Whether the query value in the database is null cannot be =null but uses is null or is not NULL
Sort operation (order by):
SELECT * FROM table name order BY column A/column A in ascending order
SELECT * FROM table name order BY column A desc/column A descending sort
2016/05/09 (Database)