1. Create data (insert data)
(1) INSERT INTO Tab_name(field list) values(Value list)
(2) If you need to set values for all fields when inserting, you can omit the field list. Requirements are the order of values and should be consistent with the order of the fields in the table.
INSERT into Tab_name values (Value list)
2. Query data (get data)
Select (Field list) from Tab_name query criteria ;
Field list, you can use * instead, representing all the fields ;
The query criteria can be omitted, indicating that all records are obtained. equivalent to where 1; (1 means always set, equivalent to default )
Conditional query: filter out a score greater than 72
SELECT * from Exam_student where fengshu>=72; (where + query condition )
3. Delete data
Delete from tab_name condition ; (remove irreversible, all conditions more stringent )
The deletion needs to strictly give the condition logically, otherwise it is easy to cause the data to operate incorrectly, resulting in loss. (where syntax can not, but logically can have)
4. Modify the data
Update tab_name SET field = new value, .... conditions, (logically with conditions)
MySQL (6): Data manipulation