当前位置:网站首页>MySQL数据库基本操作-DML
MySQL数据库基本操作-DML
2022-07-06 14:38:00 【黑马程序员官方】
MySQL性能强劲,是目前使用最广泛的数据库之一,以 MySQL为学习原型也方便之后掌握其他数据库,下面就给大家全面讲解下MySQL8.0的新特性,从零基础到高阶一站式学习,结合实际案例让大家有所收获!
▼ MySQL8.0入门-高阶学习笔记:(汇总)
- 第1讲:SQL概述及数据库系统介绍
- 第2讲:MySQL简介、详细安装步骤及使用
- 第3讲:MySQL常用图形管理工具
- 第4讲:MySQL数据库基本操作-DDL
一、基本介绍
DML是指数据操作语言,英文全称是Data Manipulation Language,用来对数据库中表的数据记录进行更新。
关键字:
- 插入insert
- 删除delete
- 更新update

二、数据插入
语法格式
insert into 表 (列名1,列名2,列名3...) values (值1,值2,值3...); //向表中插入某些
insert into 表 values (值1,值2,值3...); //向表中插入所有列例子
insert into student(sid,name,gender,age,birth,address,score)
values(1001,'男',18,'1996-12-23','北京',83.5);
insert into student values(1001,'男',18,'1996-12-23','北京',83.5);数据修改
语法格式
update 表名 set 字段名=值,字段名=值...;
update 表名 set 字段名=值,字段名=值... where 条件;例子
-- 将所有学生的地址修改为重庆
update student set address = '重庆’;
-- 讲id为1004的学生的地址修改为北京
update student set address = '北京' where id = 1004
-- 讲id为1005的学生的地址修改为北京,成绩修成绩修改为100
update student set address = '广州',score=100 where id = 1005数据删除
语法格式
delete from 表名 [where 条件];
truncate table 表名 或者 truncate 表名例子
-- 1.删除sid为1004的学生数据
delete from student where sid = 1004;
-- 2.删除表所有数据
delete from student;
-- 3.清空表数据
truncate table student;
truncate student;注意:delete和truncate原理不同,delete只删除内容,而truncate类似于drop table ,可以理解为是将整个表删除,然后再创建该表;
三、总结
Tableau中,数据源大体可以分为两类,分别是本地数据源(文件)和服务器数据源(服务)。
Tableau中排序分为自动排序和自定义排序,可以按照数据源顺序、字母、字段、手动、嵌套等规则进行排序。
边栏推荐
- NetXpert XG2帮您解决“布线安装与维护”难题
- GPS from getting started to giving up (XIII), receiver autonomous integrity monitoring (RAIM)
- 【10点公开课】:视频质量评价基础与实践
- Oracle Performance Analysis 3: introduction to tkprof
- [linear algebra] determinant of order 1.3 n
- 0 basic learning C language - digital tube
- i.mx6ull搭建boa服务器详解及其中遇到的一些问题
- Insert sort and Hill sort
- Lora sync word settings
- ResNet-RS:谷歌领衔调优ResNet,性能全面超越EfficientNet系列 | 2021 arxiv
猜你喜欢

Xiaoman network model & http1-http2 & browser cache

GPS from getting started to giving up (XV), DCB differential code deviation
The SQL response is slow. What are your troubleshooting ideas?

Spatial domain and frequency domain image compression of images

数据处理技巧(7):MATLAB 读取数字字符串混杂的文本文件txt中的数据

Embedded common computing artifact excel, welcome to recommend skills to keep the document constantly updated and provide convenience for others

Chapter 3: detailed explanation of class loading process (class life cycle)

微信红包封面小程序源码-后台独立版-带测评积分功能源码

2500个常用中文字符 + 130常用中英文字符

Unity3d Learning Notes 6 - GPU instantiation (1)
随机推荐
SQL Server生成自增序号
What a new company needs to practice and pay attention to
Seata aggregates at, TCC, Saga and XA transaction modes to create a one-stop distributed transaction solution
OpenCV VideoCapture. Get() parameter details
Search element topic (DFS)
将MySQL的表数据纯净方式导出
3DMAX assign face map
CCNA Cisco network EIGRP protocol
HDR image reconstruction from a single exposure using deep CNNs阅读札记
十二、启动流程
GPS from getting started to giving up (XIII), receiver autonomous integrity monitoring (RAIM)
The SQL response is slow. What are your troubleshooting ideas?
Oracle Performance Analysis 3: introduction to tkprof
Maximum product of three numbers in question 628 of Li Kou
[sciter bug] multi line hiding
GPS从入门到放弃(十四)、电离层延时
Codeforces Round #274 (Div. 2) –A Expression
The nearest common ancestor of binary (search) tree ●●
[Digital IC hand tearing code] Verilog burr free clock switching circuit | topic | principle | design | simulation
Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices