当前位置:网站首页>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中排序分为自动排序和自定义排序,可以按照数据源顺序、字母、字段、手动、嵌套等规则进行排序。
边栏推荐
- 网络基础入门理解
- Classic sql50 questions
- HDR image reconstruction from a single exposure using deep CNNs阅读札记
- Mongodb (III) - CRUD
- BarcodeX(ActiveX打印控件) v5.3.0.80 免费版使用
- 第3章:类的加载过程(类的生命周期)详解
- [线性代数] 1.3 n阶行列式
- What a new company needs to practice and pay attention to
- 每日一题:力扣:225:用队列实现栈
- Research and investment strategy report of China's VOCs catalyst industry (2022 Edition)
猜你喜欢

3DMax指定面贴图

Management background --1 Create classification

Heavyweight news | softing fg-200 has obtained China 3C explosion-proof certification to provide safety assurance for customers' on-site testing

Seata聚合 AT、TCC、SAGA 、 XA事务模式打造一站式的分布式事务解决方案

Xiaoman network model & http1-http2 & browser cache

Oracle control file and log file management

(十八)LCD1602实验

A Mexican airliner bound for the United States was struck by lightning after taking off and then returned safely
![[10:00 public class]: basis and practice of video quality evaluation](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[10:00 public class]: basis and practice of video quality evaluation

Unity3d minigame unity webgl transform plug-in converts wechat games to use dlopen, you need to use embedded 's problem
随机推荐
Attack and defense world miscall
zabbix 代理服务器 与 zabbix-snmp 监控
2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks
2500 common Chinese characters + 130 common Chinese and English characters
AI enterprise multi cloud storage architecture practice | Shenzhen potential technology sharing
GD32F4XX串口接收中断和闲时中断配置
anaconda安装第三方包
C # realizes crystal report binding data and printing 4-bar code
HDR image reconstruction from a single exposure using deep CNNs阅读札记
ZABBIX proxy server and ZABBIX SNMP monitoring
The nearest common ancestor of binary (search) tree ●●
414. The third largest digital buckle
2021 geometry deep learning master Michael Bronstein long article analysis
数据处理技巧(7):MATLAB 读取数字字符串混杂的文本文件txt中的数据
嵌入式常用计算神器EXCEL,欢迎各位推荐技巧,以保持文档持续更新,为其他人提供便利
做接口测试都测什么?有哪些通用测试点?
Common sense: what is "preservation" in insurance?
解决项目跨域问题
Kohana database
[sdx62] wcn685x will bdwlan Bin and bdwlan Txt mutual conversion operation method