当前位置:网站首页>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 pre training model modification, addition and deletion of specific layers]
- Error modulenotfounderror: no module named 'cv2 aruco‘
- Why do you always fail in automated tests?
- 强化学习-学习笔记3 | 策略学习
- 【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
- 信息服务器怎么恢复,服务器数据恢复怎么弄[通俗易懂]
- Check the debug port information in rancher and do idea remote JVM debug
- 【云原生 | Kubernetes篇】Ingress案例实战(十三)
- Which domestic cloud management platform manufacturer is good in 2022? Why?
- pytorch-权重衰退(weight decay)和丢弃法(dropout)
猜你喜欢
Redis集群(主从)脑裂及解决方案
【pytorch 修改预训练模型:实测加载预训练模型与模型随机初始化差别不大】
【上采样方式-OpenCV插值】
Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
Redis master-slave mode
[loss functions of L1, L2 and smooth L1]
The most comprehensive new database in the whole network, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, flying Book Multidimensional table, heipayun, Zhix
网络五连鞭
Riddle 1
Matlab imoverlay function (burn binary mask into two-dimensional image)
随机推荐
II. Data type
[loss functions of L1, L2 and smooth L1]
网络五连鞭
What is digital existence? Digital transformation starts with digital existence
Simple production of wechat applet cloud development authorization login
想问问,如何选择券商?在线开户是很安全么?
yolov5目标检测神经网络——损失函数计算原理
无线WIFI学习型8路发射遥控模块
Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
mmclassification 训练自定义数据
【主流Nivida显卡深度学习/强化学习/AI算力汇总】
语义分割实验:Unet网络/MSRC2数据集
Check the debug port information in rancher and do idea remote JVM debug
Want to ask, how to choose a securities firm? Is it safe to open an account online?
多表操作-自关联查询
ABAP table lookup program
Mmclassification training custom data
Take you two minutes to quickly master the route and navigation of flutter
Halcon 模板匹配实战代码(一)
什么是数字化存在?数字化转型要先从数字化存在开始