二、DML语句

 

create database mydata

 

use mydata

go

 

create table stu

(

[name] varchar(10) not null,

age int,

score int not null,

phone char(11)

)

1,select

select * from stu

 

2,insert

insert into stu values('cheng',null,56,'11111')

 

insert stu([name],score,phone) values('zhao',57,'3333')

 

3,update

update stu set phone='1111' where [name]='cheng'

 

4.delete

delete from stu 

 

delete from stu where [name]='cheng'

 

5,truncate

truncate table stu

 

 

select 'mydb' 

 

declare @a int 

set @a=18

select @a

 

select @@version

 

select * from stu1

 

select * into stu1 from stu

 

select * into stu2 from stu where 1=2

select * from stu2

 

select * into stu3 from stu where [name]='wang'

select * from stu3

 

select [name],score into stu4 from stu

select * from stu4

 

select [name],score into stu5 from stu where [name]='cheng'

select * from stu5

 

insert into stu select * from stu1

select * from stu

 

insert into stu([name],score) select * from stu4 where [name]='cheng'

select * from stu1

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值