DML语言 插入语句

数据操作语言

插入 insert

修改update

删除 delete

插入语法

方式一

表和values  必须要对应

insert  into  表(数据类型。。。。比如 id  姓名) values(。。。)

方式一  可以用子查询

比如

insert into  表 (id,name)   select   12,‘xxx’  ;

 

方式二

insert   into 表

set  id=xxx   。。。

修改语句  update

语法

update  表   set   列 = “值”  where  筛选条件

update 表    inner join  表2  on 连接语句  set  xxx   where  筛选条件

 

delete  删除语法

delete  from  表  where

truncate   table  表       表示直接把某个表直接删除

 

truncate  没有返回值   delete  有返回值

truncate   不能回滚   delete  可以回滚

 

posted @ 2021-04-20 16:23  Dasn  阅读(49)  评论(0)    收藏  举报