当前位置:网站首页>Mysql database basic operations DML
Mysql database basic operations DML
2022-07-06 22:24:00 【Dark horse programmer official】
MySQL Strong performance , It is one of the most widely used databases at present , With MySQL For learning the prototype, it is also convenient to master other databases later , Now let's give you Give a comprehensive explanation MySQL8.0 New features , From zero foundation to high-level one-stop learning , Combined with actual cases, we can gain something !
▼ MySQL8.0 introduction - Advanced learning notes :( Summary )
- The first 1 speak :SQL Overview and database system introduction
- The first 2 speak :MySQL brief introduction 、 Detailed installation steps and use
- The first 3 speak :MySQL Common graphics management tools
- The first 4 speak :MySQL Basic operation of database -DDL
One 、 Basic introduction
DML It refers to the data operation language , The full English name is Data Manipulation Language, Used to update the data records of tables in the database .
keyword :
- Insert insert
- Delete delete
- to update update
Two 、 Insert data into
Grammar format
insert into surface ( Name 1, Name 2, Name 3...) values ( value 1, value 2, value 3...); // Insert some... Into the table
insert into surface values ( value 1, value 2, value 3...); // Insert all columns... Into the table
Example
insert into student(sid,name,gender,age,birth,address,score)
values(1001,' male ',18,'1996-12-23',' Beijing ',83.5);
insert into student values(1001,' male ',18,'1996-12-23',' Beijing ',83.5);
Data modification
Grammar format
update Table name set Field name = value , Field name = value ...;
update Table name set Field name = value , Field name = value ... where Conditions ;
Example
-- Change the address of all students to Chongqing
update student set address = ' Chongqing ’;
-- speak id by 1004 The address of the student is changed to Beijing
update student set address = ' Beijing ' where id = 1004
-- speak id by 1005 The address of the student is changed to Beijing , The grade is revised to 100
update student set address = ' Guangzhou ',score=100 where id = 1005
Data deletion
Grammar format
delete from Table name [where Conditions ];
truncate table Table name perhaps truncate Table name
Example
-- 1. Delete sid by 1004 Student data for
delete from student where sid = 1004;
-- 2. Delete all data from the table
delete from student;
-- 3. Clear table data
truncate table student;
truncate student;
Be careful :delete and truncate The principle is different ,delete Only delete content , and truncate Be similar to drop table , It can be understood as deleting the whole table , Then create the table ;
3、 ... and 、 summary
Tableau in , Data sources can be roughly divided into two categories , They are local data sources ( file ) And server data sources ( service ).
Tableau Sorting is divided into automatic sorting and custom sorting , It can be in the order of data sources 、 Letter 、 Field 、 Manual 、 Sort by nesting rules .
边栏推荐
- 如何用程序确认当前系统的存储模式?
- 2022-07-04 mysql的高性能数据库引擎stonedb在centos7.9编译及运行
- Barcodex (ActiveX print control) v5.3.0.80 free version
- Common sense: what is "preservation" in insurance?
- LeetCode刷题(十一)——顺序刷题51至55
- HDU 2008 digital statistics
- NetXpert XG2帮您解决“布线安装与维护”难题
- extern关键字
- PVL EDI 项目案例
- 0 basic learning C language - interrupt
猜你喜欢
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
BarcodeX(ActiveX打印控件) v5.3.0.80 免费版使用
Aardio - 通过变量名将变量值整合到一串文本中
Spatial domain and frequency domain image compression of images
【10点公开课】:视频质量评价基础与实践
NetXpert XG2帮您解决“布线安装与维护”难题
2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks
CCNA-思科网络 EIGRP协议
二叉(搜索)树的最近公共祖先 ●●
Aardio - 不声明直接传float数值的方法
随机推荐
Common sense: what is "preservation" in insurance?
AI enterprise multi cloud storage architecture practice | Shenzhen potential technology sharing
Force deduction question 500, keyboard line, JS implementation
Four data streams of grpc
Codeforces Round #274 (Div. 2) –A Expression
CCNA Cisco network EIGRP protocol
0 basic learning C language - digital tube
嵌入式常用计算神器EXCEL,欢迎各位推荐技巧,以保持文档持续更新,为其他人提供便利
Force buckle 575 Divide candy
Aardio - 不声明直接传float数值的方法
MySQL约束的分类、作用及用法
RESNET rs: Google takes the lead in tuning RESNET, and its performance comprehensively surpasses efficientnet series | 2021 arXiv
The nearest common ancestor of binary (search) tree ●●
Insert sort and Hill sort
QT | UDP broadcast communication, simple use case
插入排序与希尔排序
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
Attack and defense world miscall
3DMax指定面贴图
PVL EDI 项目案例