当前位置:网站首页>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
边栏推荐
- 跨平台(32bit和64bit)的 printf 格式符 %lld 输出64位的解决方式
- Codeworks 5 questions per day (1700 average) - day 5
- codeforces每日5题(均1700)-第五天
- Multi table operation - sub query
- yolov5目标检测神经网络——损失函数计算原理
- Yolov 5 Target Detection Neural Network - Loss Function Calculation Principle
- splunk配置163邮箱告警
- pytorch-线性回归
- pytorch-softmax回归
- 【上采样方式-OpenCV插值】
猜你喜欢

【SingleShotMultiBoxDetector(SSD,单步多框目标检测)】

Linux安装部署LAMP(Apache+MySQL+PHP)

Pytorch MLP

Splunk configuration 163 mailbox alarm

【使用TensorRT通过ONNX部署Pytorch项目】

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

Pytorch softmax regression
![[loss functions of L1, L2 and smooth L1]](/img/c6/27eab1175766b77d4f030b691670c0.png)
[loss functions of L1, L2 and smooth L1]
Why do you always fail in automated tests?

How to make your products as expensive as possible
随机推荐
全网最全的新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀
pytorch-多层感知机MLP
Tabbar configuration at the bottom of wechat applet
你做自动化测试为什么总是失败?
谜语1
Multi table operation - sub query
【 YOLOv3中Loss部分计算】
信息服务器怎么恢复,服务器数据恢复怎么弄[通俗易懂]
Programmers are involved and maintain industry competitiveness
Reinforcement learning - learning notes 3 | strategic learning
[calculation of loss in yolov3]
July Huaqing learning-1
The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
POJ-2499 Binary Tree
Matlab superpixels function (2D super pixel over segmentation of image)
Yolov5 target detection neural network -- calculation principle of loss function
leetcode:1200. Minimum absolute difference
【主流Nivida显卡深度学习/强化学习/AI算力汇总】
【L1、L2、smooth L1三类损失函数】
Simple production of wechat applet cloud development authorization login