增删改.sql

来自「简单的sql语句 数据与汇总。 高手多多指点。」· SQL 代码 · 共 90 行

SQL
90
字号
select * from customers
go

insert customers
(CustomerID,CompanyName,ContactName,ContactTitle,Address,City,Region,Country,Phone,Fax)
values
('PECOF','Pecos Coffee Company','Michael Dunn','Owner','1900 Oak Street','Vancouver','Bc','V3f 2k1','Canada'
 ,'(604) 555-7293')
go



create table a
(cutomerid tinyint  not null primary key,
 name varchar(10) not null,
 age tinyint default(20),
)
go

create table b
(custid  tinyint not null primary key,
 name varchar(10) not null,
age tinyint default(20)
)
go

drop table a
go

insert a
select custid,name,age from b
go

select * from a
go

select productname as products,unitprice as price,(unitprice*1.1) as tax 
into #pricetable
from products
go

/*新建窗口,在另外窗口键入代码“select * from #pricetable ”不能看见本地临时表*/

select * from #pricetable 
go

select productname as products,unitprice as price,(unitprice*1.1) as tax 
into ##pricetable
from products
go

/*新建窗口,在另外窗口键入代码“select * from ##pricetable ”就能看见全局临时表*/

select * from shippers
go

exec sp_help shippers
go
 
select identitycol from shippers
go

insert shippers(companyname)
values('Fitch & Mather') 
go

update  b
set age=age*2
go

delete b
where age=44
go

select * from b
go

delete b 
from

exec sp_help_fulltext_catalogs
go

exec sp_help_fulltext_tables
go

exec sp_help_fulltext_columns
go

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?