当前位置:网站首页>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
边栏推荐
- IPv6与IPv4的区别 网信办等三部推进IPv6规模部署
- Matlab label2idx function (convert the label matrix into a cell array with linear index)
- 多表操作-自关联查询
- 1个插件搞定网页中的广告
- vscode快捷键
- MVVM framework part I lifecycle
- [HDU 2096] 小明A+B
- Redis cluster (master-slave) brain crack and solution
- Linux Installation and deployment lamp (apache+mysql+php)
- Error modulenotfounderror: no module named 'cv2 aruco‘
猜你喜欢

Select drop-down box realizes three-level linkage of provinces and cities in China

查看rancher中debug端口信息,并做IDEA Remote Jvm Debug

谜语1

redis主从模式

How to make your products as expensive as possible

July Huaqing learning-1

liunx禁ping 详解traceroute的不同用法

Error modulenotfounderror: no module named 'cv2 aruco‘

How to clear floating?

pytorch-softmax回归
随机推荐
How to make your products as expensive as possible
redis主从中的Master自动选举之Sentinel哨兵机制
Want to ask, how to choose a securities firm? Is it safe to open an account online?
一类恒等式的应用(范德蒙德卷积与超几何函数)
Riddle 1
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
Reinforcement learning - learning notes 3 | strategic learning
Image hyperspectral experiment: srcnn/fsrcnn
Why do you always fail in automated tests?
【 YOLOv3中Loss部分计算】
Time tools
想问问,如何选择券商?在线开户是很安全么?
Seven ways to achieve vertical centering
Splunk configuration 163 mailbox alarm
Swift - add navigation bar
POJ-2499 Binary Tree
Sentinel sentinel mechanism of master automatic election in redis master-slave
Course design of compilation principle --- formula calculator (a simple calculator with interface developed based on QT)
Simple production of wechat applet cloud development authorization login
Reading notes of growth hacker