当前位置:网站首页>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
边栏推荐
- Error modulenotfounderror: no module named 'cv2 aruco‘
- 【pytorch 修改预训练模型:实测加载预训练模型与模型随机初始化差别不大】
- Course design of compilation principle --- formula calculator (a simple calculator with interface developed based on QT)
- Four operations and derivative operations of MATLAB polynomials
- Matlab struct function (structure array)
- 1 plug-in to handle advertisements in web pages
- Network five whip
- 嵌入式软件架构设计-消息交互
- 只是巧合?苹果 iOS16 的神秘技术竟然与中国企业 5 年前产品一致!
- The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
猜你喜欢

1个插件搞定网页中的广告

mmclassification 训练自定义数据

Error modulenotfounderror: no module named 'cv2 aruco‘

Principle of persistence mechanism of redis
The survey shows that traditional data security tools cannot resist blackmail software attacks in 60% of cases

abap查表程序

互联网公司实习岗位选择与简易版职业发展规划

mysql拆分字符串做条件查询
调查显示传统数据安全工具在60%情况下无法抵御勒索软件攻击

无线WIFI学习型8路发射遥控模块
随机推荐
What is the difference between canvas and SVG?
查看rancher中debug端口信息,并做IDEA Remote Jvm Debug
一类恒等式的应用(范德蒙德卷积与超几何函数)
pytorch-softmax回归
Pytorch linear regression
HiEngine:可媲美本地的云原生内存数据库引擎
Halcon 模板匹配实战代码(一)
Semantic segmentation experiment: UNET network /msrc2 dataset
Redis master-slave mode
How to make your products as expensive as possible
【云原生 | Kubernetes篇】Ingress案例实战(十三)
你做自动化测试为什么总是失败?
Redis cluster (master-slave) brain crack and solution
Complete activity switching according to sliding
Liunx prohibit Ping explain the different usage of traceroute
July Huaqing learning-1
redis主从中的Master自动选举之Sentinel哨兵机制
互联网公司实习岗位选择与简易版职业发展规划
Yolov5 target detection neural network -- calculation principle of loss function
Codeforces Round #804 (Div. 2)