当前位置:网站首页>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中排序分为自动排序和自定义排序,可以按照数据源顺序、字母、字段、手动、嵌套等规则进行排序。
边栏推荐
- 重磅新闻 | Softing FG-200获得中国3C防爆认证 为客户现场测试提供安全保障
- AI enterprise multi cloud storage architecture practice | Shenzhen potential technology sharing
- Common sense: what is "preservation" in insurance?
- 小程序系统更新提示,并强制小程序重启并使用新版本
- GPS从入门到放弃(十一)、差分GPS
- GPS from getting started to giving up (XVIII), multipath effect
- [sciter bug] multi line hiding
- 插入排序与希尔排序
- Report on technological progress and development prospects of solid oxide fuel cells in China (2022 Edition)
- 【数字IC手撕代码】Verilog无毛刺时钟切换电路|题目|原理|设计|仿真
猜你喜欢

GPS从入门到放弃(十二)、 多普勒定速

重磅新闻 | Softing FG-200获得中国3C防爆认证 为客户现场测试提供安全保障

Management background --4, delete classification

Daily question 1: force deduction: 225: realize stack with queue

GPS du début à l'abandon (XIII), surveillance autonome de l'intégrité du récepteur (raim)

墨西哥一架飞往美国的客机起飞后遭雷击 随后安全返航

Adjustable DC power supply based on LM317

Chapter 4: talk about class loader again

AI enterprise multi cloud storage architecture practice | Shenzhen potential technology sharing

GPS from getting started to giving up (16), satellite clock error and satellite ephemeris error
随机推荐
How does the uni admin basic framework close the creation of super administrator entries?
Inno Setup 打包及签名指南
2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks
Leetcode question brushing (XI) -- sequential questions brushing 51 to 55
Management background --3, modify classification
网络基础入门理解
BarcodeX(ActiveX打印控件) v5.3.0.80 免费版使用
Save and retrieve strings
Mongodb (III) - CRUD
2500 common Chinese characters + 130 common Chinese and English characters
Management background --1 Create classification
labelimg的安装与使用
Oracle-控制文件及日志文件的管理
将MySQL的表数据纯净方式导出
GPS from entry to abandonment (XVII), tropospheric delay
Learn the principle of database kernel from Oracle log parsing
About the professional ethics of programmers, let's talk about it from the way of craftsmanship and neatness
Classic sql50 questions
RESNET rs: Google takes the lead in tuning RESNET, and its performance comprehensively surpasses efficientnet series | 2021 arXiv
[Digital IC hand tearing code] Verilog burr free clock switching circuit | topic | principle | design | simulation