当前位置:网站首页>SQL中DML语句(数据操作语言)
SQL中DML语句(数据操作语言)
2022-07-01 06:17:00 【HHYZBC】
表示数据操作语言(凡是对表当中的数据进行增删改的都是DML)
目录
insert(插入数据)
语法格式:
insert into 表名(字段名1,字段名2,字段名3...) values(值1,值2,值3);
数量要对应。数据类型要对应。
字段名可以省略,省略后添加的值都要写上。
如果需要同时插入多个值时:
insert into t_user(字段名1,字段名2) values(),(),(),();
values后面中括号内,一个括号表示一个数据
update(修改数据)
语法格式:
update 表名 set 字段名1=值1,字段名2=值2,字段名3=值3... where 条件;
没有条件限制会导致所有数据全部更新。
delete (删除数据)
语法格式:
delete from 表名 where 条件;
一般与条件查询连用,表示删除满足条件的数据,如果没有条件时,则整张表的数据会全部删除!,并且delete这种方式会比较慢,如果需要考虑效率问题的话可使用truncate语句。使用方法在DDL语句中有写。
边栏推荐
- 阶乘约数(唯一分解定理)
- DHT11 温湿度传感器
- SystemVerilog learning-07-class inheritance and package use
- To sort out the anomaly detection methods, just read this article!
- three. JS summary
- 【ITSM】什么是ITSM,IT部门为什么需要ITSM
- High order binary balanced tree
- ArcServer密码重置(账号不可以重置)
- Golang panic recover custom exception handling
- Flink实战--多流合并
猜你喜欢
随机推荐
SystemVerilog learning-07-class inheritance and package use
让田头村变甜头村的特色农产品是仙景芋还是白菜
HCM Beginner (I) - Introduction
【ManageEngine卓豪】助力黄石爱康医院实现智能批量化网络设备配置管理
Kubedm builds kubenetes cluster (Personal Learning version)
Factorial divisor (unique decomposition theorem)
连续四年入选Gartner魔力象限,ManageEngine卓豪是如何做到的?
JMM details
记磁盘扇区损坏导致的Mysql故障排查
子类调用父类的同名方法和属性
Stack Title: parsing Boolean expressions
ONEFLOW source code parsing: automatic inference of operator signature
[summary of problem thinking] Why is the register reset performed in user mode?
Solve the problem of garbled files uploaded by Kirin v10
分布式锁实现
SystemVerilog learning-09-interprocess synchronization, communication and virtual methods
[leetcode] day91- duplicate elements exist
数据库产生死锁了请问一下有没有解决办法
【企业数据安全】升级备份策略 保障企业数据安全
How does MySQL store Emoji?









