AdventureWorks と pubs テーブルの比較

AdventureWorks のサンプル データベース内にある一部のテーブルは、その構造と内容に関して、pubs のサンプル データベース内にあるテーブルと類似しています。次の表を参照し、適切な AdventureWorks テーブルから列を選択することによって、pubs を使用するクエリを、AdventureWorks を使用するクエリに変換できます。たとえば、pubsdiscounts テーブルをクエリが参照する場合は、Sales.SpecialOffer テーブルを使用することによって、AdventureWorks に関して類似したクエリを作成することができます。ただし、AdventureWorksdbo 以外のスキーマ名を使用することに注意してください。テーブルに対するクエリを実行する際には、スキーマ名とテーブル名の両方を指定する必要があります。詳細については、「AdventureWorks のスキーマ」を参照してください。

pubs AdventureWorks コメント

authors

Purchasing.Vendor

 

discounts

Sales.SpecialOffer

 

employee

HumanResources.Employee

 

jobs

HumanResources.Employee

EmployeeTitle 列を参照します。

pub_info2

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

MinQty 列と MaxQty 列を参照します。

sales

Sales.SalesOrderHeader

Sales.SalesOrderDetail

 

stores

Sales.Store

 

titleauthor

Production.ProductVendor

titleauthor は、著者を書名にマップする結合テーブルです。Production.ProductVendor は、仕入先を製品 (Adventure Works Cycles に販売される製品) にマップします。

titles

Production.Product

 

参照

概念

AdventureWorks と Northwind テーブルの比較

その他の技術情報

AdventureWorks サンプル OLTP データベース
Northwind サンプル データベースと pubs サンプル データベースのダウンロード
AdventureWorks データ辞書

ヘルプおよび情報

SQL Server 2005 の参考資料の入手