Dml:insert, DELETE, UPDATE, SELECT
INSERT into:
INSERT [into] tbl_name [(col1,...)] {values| VALUE} (Val1, ...), (...),...
Attention:
Character type: quotation marks;
Numeric type: cannot use quotation marks;
SELECT:
(1) SELECT * from Tbl_name;
(2) SELECT col1, col2, ... from Tbl_name;
When displayed, the field can be displayed as an alias;
Col_name as Col_alias
(3) SELECT col1, ... from Tbl_name WHERE clause;
WHERE clause: Used to specify the selection criteria;
Col_name operator Value:
Age > 30;
Operator (1):
, <, >=, <=, = =,! =
Combination conditions:
and
Or
Not
Operator (2):
Between ... And ...
Like ' PATTERN '
Wildcard characters:
%: Any character of any length;
_: any single character;
Rlike ' PATTERN '
The regular expression matches the string pattern;
Is NULL
is not NULL
(4) SELECT col1, ... from Tbl_name [WHERE clause] ORDER by col_name, Col_name2, ... [asc| DESC];
ASC: Ascending;
Desc: Descending;
DELETE:
DELETE from Tbl_name [WHERE where_condition] [ORDER by ...] [LIMIT Row_count] (1) DELETE from Tbl_name WHERE where_condition
(2) DELETE from Tbl_name [ORDER by ...] [LIMIT Row_count]
UPDATE:
UPDATE [low_priority] [IGNORE] table_reference SET col_name1=value1 [, Col_name2=value2] ... [WHERE Where_condition] [ORDER by ...] [LIMIT Row_count]
This article is from the "Wang Liming" blog, make sure to keep this source http://afterdawn.blog.51cto.com/7503144/1925921
MySQL Learning Note (6-dml command)