当前位置:网站首页>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-softmax回归
- yolov5目标检测神经网络——损失函数计算原理
- 一类恒等式的应用(范德蒙德卷积与超几何函数)
- 1 plug-in to handle advertisements in web pages
- One article tells the latest and complete learning materials of flutter
- Matlab imoverlay function (burn binary mask into two-dimensional image)
- Simple production of wechat applet cloud development authorization login
- Understand kotlin from the perspective of an architect
- MVVM framework part I lifecycle
- Pytorch weight decay and dropout
猜你喜欢
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"

Matlab imoverlay function (burn binary mask into two-dimensional image)

mysql拆分字符串做条件查询

Redis cluster (master-slave) brain crack and solution
![[upsampling method opencv interpolation]](/img/6b/5e8f3c2844f0cbbbf03022e0efd5f0.png)
[upsampling method opencv interpolation]

Redis集群(主从)脑裂及解决方案
Why do you always fail in automated tests?

【上采样方式-OpenCV插值】

Multi table operation - sub query

Pytorch weight decay and dropout
随机推荐
[calculation of loss in yolov3]
图像超分实验:SRCNN/FSRCNN
报错ModuleNotFoundError: No module named ‘cv2.aruco‘
[loss functions of L1, L2 and smooth L1]
Understand kotlin from the perspective of an architect
Is investment and finance suitable for girls? What financial products can girls buy?
Ncp1342 chip substitute pn8213 65W gallium nitride charger scheme
语义分割实验:Unet网络/MSRC2数据集
Intern position selection and simplified career development planning in Internet companies
手机 CPU 架构类型了解
Halcon template matching actual code (I)
自动化测试生命周期
mmclassification 训练自定义数据
Select drop-down box realizes three-level linkage of provinces and cities in China
Vscode shortcut key
redis主从中的Master自动选举之Sentinel哨兵机制
Codeworks 5 questions per day (1700 average) - day 5
Codeforces Round #804 (Div. 2)
[yolov3 loss function]
全网最全的新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀