DML modify the data in the table
Including three parts
adding data
INSERT [INTO] 表名 [字段名] VALUES (字段值)
INSERT INTO table name: adding data representing where to tables in the
(field name 1, field name 2, ...): to give what field settings
VALUES (value 1, value 2, ...): set a specific value
for the student information section added
if To add all the attributes, you can omit a part
delete data
1. Conditionally delete
DELETE FROM 表名 WHERE 字段名=值;
Delete the record with id=1
2. Delete without condition (the table still exists)
DELETE FROM 表名;
3. Delete without conditions (the table does not exist, and a new table with the same will be created)
TRUNCATE TABLE 表名;
Add two more pieces of data
After deleting
change the data
1. Conditional modification
UPDATE 表名 SET 列名=值 [WHERE 条件表达式]
Change jack's age to 20
2. Modification without conditions
UPDATE 表名 SET 字段名=值; -- 修改所有的行
Change the age of all students to 20