当前位置:网站首页>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中排序分为自动排序和自定义排序,可以按照数据源顺序、字母、字段、手动、嵌套等规则进行排序。
边栏推荐
- Management background --4, delete classification
- 0 basic learning C language - digital tube
- 嵌入式常用计算神器EXCEL,欢迎各位推荐技巧,以保持文档持续更新,为其他人提供便利
- What are the interface tests? What are the general test points?
- lora同步字设置
- The nearest common ancestor of binary (search) tree ●●
- qt quick项目offscreen模式下崩溃的问题处理
- HDU 4912 paths on the tree (lca+)
- Daily question 1: force deduction: 225: realize stack with queue
- Report on technological progress and development prospects of solid oxide fuel cells in China (2022 Edition)
猜你喜欢
2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks
GPS从入门到放弃(十七) 、对流层延时
Assembly and interface technology experiment 5-8259 interrupt experiment
[leetcode daily clock in] 1020 Number of enclaves
剪映+json解析将视频中的声音转换成文本
[MySQL] online DDL details
Learn the principle of database kernel from Oracle log parsing
数据处理技巧(7):MATLAB 读取数字字符串混杂的文本文件txt中的数据
Unity3d minigame unity webgl transform plug-in converts wechat games to use dlopen, you need to use embedded 's problem
The SQL response is slow. What are your troubleshooting ideas?
随机推荐
AI enterprise multi cloud storage architecture practice | Shenzhen potential technology sharing
CCNA-思科网络 EIGRP协议
0 basic learning C language - interrupt
[线性代数] 1.3 n阶行列式
二叉(搜索)树的最近公共祖先 ●●
GPS from getting started to giving up (XVIII), multipath effect
GNN,请你的网络层数再深一点~
Embedded common computing artifact excel, welcome to recommend skills to keep the document constantly updated and provide convenience for others
【sciter】: 基于 sciter 封装通知栏组件
Daily question 1: force deduction: 225: realize stack with queue
第4章:再谈类的加载器
anaconda安装第三方包
PVL EDI 项目案例
China 1,4-cyclohexanedimethanol (CHDM) industry research and investment decision-making report (2022 Edition)
A Mexican airliner bound for the United States was struck by lightning after taking off and then returned safely
Chapter 4: talk about class loader again
Inno Setup 打包及签名指南
[sdx62] wcn685x will bdwlan Bin and bdwlan Txt mutual conversion operation method
What is the difference between animators and animators- What is the difference between an Animator and an Animation?
C # réalise la liaison des données du rapport Crystal et l'impression du Code à barres 4