/****** Script for SelectTopNRows command from SSMS ******/
--day01基础知识--
SELECT TOP 1000
[CustomerID]
,[CustomerName]
,[ContactName]
,[Address]
,[City]
,[PostalCode]
,[Country]
FROM [sdata].[dbo].[Customers] 表Customers名称
drop table sdata.[dbo].[Customers2] 删除表
CREATE TABLE sdata.[dbo].[Customers2]( 创建表Customers2
[CustomerID] [int] not NULL,
[CustomerName] [nvarchar](255) NULL,
[ContactName] [nvarchar](255) NULL,
[Address] [nvarchar](255) NULL,
[City] [nvarchar](255) NULL,
[PostalCode] [nvarchar](255) NULL,
[Country] [nvarchar](255) NULL
) ON [PRIMARY]
GO
insert into [sdata].[dbo].[Customers] 插入数据
(
[CustomerID]
,[ContactName]
,[CustomerName]
,[Address]
,[City]
,[PostalCode]
,[Country]
)
values('9','8','7','6','5','4','3')
insert into sdata.dbo.Customers values ('1','Alfreds Futterkiste','Maria Anders','Obere Str. 57','Berlin','12209','Germany')
insert into sdata.dbo.Customers values ('2','Ana Trujillo Emparedados y helados','Ana Trujillo','Avda. de la Constitución 2222','México D.F.','5021','Mexico')
insert into sdata.dbo.Customers values ('3','Antonio Moreno Taquería','Antonio Moreno','Mataderos 2312','México D.F.','5023','Mexico')
insert into sdata.dbo.Customers values ('4','Around the Horn','Thomas Hardy','120 Hanover Sq.','London','WA1 1DP','UK')
insert into sdata.dbo.Customers values ('5','Berglunds snabbköp','Christina Berglund','Berguvsvägen 8','Luleå','S-958 22','Swede')
insert into [sdata].[dbo].[Customers2] 插入数据到表Customers2
(
[CustomerID]
,[ContactName]
,[CustomerName]
,[Address]
,[City]
,[PostalCode]
,[Country]
)
values('2','cs','7','6','5','4','3')
select top 100* FROM [sdata].[dbo].[Customers2] 查询数据表2 top 100是显示前100条数据
create table sdata.dbo.one1( 创建表one1
CustomerID int
,CustomerName varchar
,ContactName varchar
,Address varchar
,City varchar
,PostalCode varchar
,Country varchar
)
insert into [sdata].[dbo].[one1] 插入数据到表三
(
[CustomerID]
,[ContactName]
,[CustomerName]
,[Address]
,[City]
,[PostalCode]
,[Country]
)
values('9','8','7','6','5','4','3')
select * from sdata.dbo.one1