当前位置:网站首页>Basic operations of MySQL data table, addition, deletion and modification & DML
Basic operations of MySQL data table, addition, deletion and modification & DML
2022-07-05 12:12:00 【ziyi813】
MySql Basic operation -DML
DML explain
DML It refers to the data operation language , The full English name is (Data Manipulation Language), Used to add data records of tables in the database 、 Delete 、 modify .
keyword :
- insert Insert
- update to update
- delete Delete
Insert data into insert
Grammar format :
insert into surface ( Column 1, Column 2, Column 3, …) values ( value 1, value 2, value 3, …); // Insert values... Into the table , Must match type
insert into surface values ( value 1, value 2, value 3, …); // Insert values for all columns
Example :
insert into student (sid, name, gender, age, birth, address) values (1, ‘oscar’, ‘man’, 18, ‘2010-12-12’, ‘ Longgang District, Shenzhen ’);
Data update update
Grammar format :
update Table name set Field name = value , Field name = value
Example :
# There are no conditions , Then all addresses of the whole table will be changed to Shenzhen
update student set address = ' Shenzhen '
# With query criteria , Only specified conditions take effect
update student set address = ' Shenzhen ' where id = 1
# You can update the values of multiple fields at the same time , Separated by commas
update student set address = ' Shenzhen ', name = 'litchi' where id = 1
Data deletion delete
Grammar format
delete form Table name [where Conditions ]
truncate table Table name perhaps truncate Table name
Example :
-- Delete sid by 1 The data of
delete form student where sid = 1
-- Delete all data from the table
delete from student;
-- Empty data
truncate table student;
truncate student;
delete Is to delete all data in the table , and truncate Is equivalent to deleting the table and then rebuilding the table data structure , More thorough .
summary
DML Data manipulation language , Mainly aimed at MySql Add, delete and change
Three basic operations :
insert
delete
update
边栏推荐
- pytorch-多层感知机MLP
- Swift - add navigation bar
- Intern position selection and simplified career development planning in Internet companies
- Reinforcement learning - learning notes 3 | strategic learning
- Linux安装部署LAMP(Apache+MySQL+PHP)
- [loss functions of L1, L2 and smooth L1]
- 【load dataset】
- Seven polymorphisms
- 【TFLite, ONNX, CoreML, TensorRT Export】
- MVVM framework part I lifecycle
猜你喜欢
[calculation of loss in yolov3]
7月华清学习-1
Matlab struct function (structure array)
[yolov5.yaml parsing]
mysql拆分字符串做条件查询
[cloud native | kubernetes] actual battle of ingress case (13)
Automated test lifecycle
redis主从中的Master自动选举之Sentinel哨兵机制
Use and install RkNN toolkit Lite2 on itop-3568 development board NPU
Redis master-slave mode
随机推荐
2022年国内云管平台厂商哪家好?为什么?
[yolov5.yaml parsing]
一款新型的智能家居WiFi选择方案——SimpleWiFi在无线智能家居中的应用
Uniapp + unicloud + Unipay realize wechat applet payment function
II. Data type
Matlab label2idx function (convert the label matrix into a cell array with linear index)
7月华清学习-1
Redis master-slave mode
ABAP table lookup program
Design of music box based on assembly language
Understand kotlin from the perspective of an architect
Time tools
【yolov5.yaml解析】
[loss functions of L1, L2 and smooth L1]
查看rancher中debug端口信息,并做IDEA Remote Jvm Debug
ACID事务理论
[mainstream nivida graphics card deep learning / reinforcement learning /ai computing power summary]
Video networkState 属性
PXE启动配置及原理
[singleshotmultiboxdetector (SSD, single step multi frame target detection)]