DML data manipulation language
It is used to perform operations on data (insert, delete, modify) in the data table.
insert data
grammar
insert into <tablename> (columnName1,columnName2,...) values(value1, value2,...)
- Here only columnName1, columnName2,... and value1, value2,... are required to be in one-to-one correspondence.
Although, if all fields are to be entered, he can also omit the field name, but in the actual project, the field name will still be listed to enhance the stability of SQL.
examplemysql> INSERT into students(stu_num, stu_name, stu_gender, stu_age, stu_tel) values('20220601','bill','Male','17','18888888888');
delete data
grammar
delete from <tableName> where ****
- Delete the data of the entire table:
delete from <tableName>
Delete some data:
delete from stus where stu_num='20220609'
change the data
grammar
update <tablename> set columnName=value [where]
modify a column
update stus set stu_gender='Male' where stu_num='20220602'
Modify multiple columns
update stus set stu_gender='Male',stu_qq='88888'where stu_num='20220602'
Modify all other columns based on primary key
update stus set stu_name='Hanna', stu_gender='Female',stu_qq='2222333'
where stu_num='20220606'
Reference: bilibili
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。