pubs와 AdventureWorks 테이블 비교

AdventureWorks 예제 데이터베이스의 일부 테이블은 pubs 예제 데이터베이스의 테이블과 구조 및 내용이 비슷합니다. 다음 표에서 적절한 AdventureWorks 테이블의 열을 선택하여 pubs 데이터베이스를 사용하는 쿼리를 AdventureWorks 데이터베이스를 사용하는 쿼리로 변환할 수 있습니다. 예를 들어 pubsdiscounts 테이블을 참조하는 쿼리가 있는 경우 Sales.SpecialOffer 테이블을 사용하여 이와 유사한 AdventureWorks 쿼리를 작성할 수 있습니다. AdventureWorks에서는 dbo가 아닌 다른 스키마 이름을 사용합니다. 스키마 이름은 테이블 이름에 포함되며 테이블에 대해 쿼리를 수행할 때 지정해야 합니다. 자세한 내용은 AdventureWorks의 스키마를 참조하십시오.

pubs AdventureWorks 설명

authors

Purchasing.Vendor

 

discounts

Sales.SpecialOffer

 

employee

HumanResources.Employee

 

jobs

HumanResources.Employee

Employee에서 Title 열을 참조하십시오.

pub_info

Production.ProductPhoto

Production.ProductDescription

 

publishers

Sales.Store

Person.Address

Sales.CustomerAddress

Person.CountryRegion

Person.StateProvince

다음 쿼리는 publishers 테이블에서 동일한 정보를 반환합니다.

USE AdventureWorks;

GO

SELECT S.CustomerID, S.Name

  AS Store, A.City, SP.Name AS

  State, CR.Name AS CountryRegion

FROM Sales.Store AS S

JOIN Sales.CustomerAddress CA

ON CA.CustomerID =  S.CustomerID

JOIN Person.Address AS A ON  A.AddressID = CA.AddressID

JOIN Person.StateProvince AS SP

ON SP.StateProvinceID =  A.StateProvinceID

JOIN Person.CountryRegion AS CR

ON CR.CountryRegionCode = SP.CountryRegionCode

GROUP BY S.CustomerID, S.Name,

    A.City, SP.Name, CR.Name

ORDER BY S.CustomerID;

roysched

Sales.SpecialOffer

MinQtyMaxQty 열을 참조하십시오.

sales

Sales.SalesOrderHeader

Sales.SalesOrderDetail

 

stores

Sales.Store

 

titleauthor

Production.ProductVendor

titleauthor는 authors를 titles에 매핑하는 연관 테이블입니다. Production.ProductVendor는 Adventure Works Cycles에 공급되는 제품과 해당 공급업체를 매핑합니다.

titles

Production.Product

 

참고 항목

개념

AdventureWorks와 Northwind 테이블 비교

관련 자료

AdventureWorks 예제 OLTP 데이터베이스
Northwind 및 pubs 예제 데이터베이스 다운로드
AdventureWorks 데이터 사전

도움말 및 정보

SQL Server 2005 지원 받기