AdventureWorks

Basic Index   Expanded Index

View Name:Production.vProductAndDescription
Description:Product names and descriptions. Product descriptions are provided in multiple languages.

FieldTypeNulls?
ProductIDintNo
Namenvarchar (50)No
ProductModelnvarchar (50)No
CultureIDnchar (6)No
Descriptionnvarchar (400)No

CREATE VIEW [Production].[vProductAndDescription]
WITH SCHEMABINDING
AS
SELECT
p.[ProductID]
,p.[Name]
,pm.[Name] AS [ProductModel]
,pmx.[CultureID]
,pd.[Description]
FROM [Production].[Product] p
INNER JOIN [Production].[ProductModel] pm
ON p.[ProductModelID] = pm.[ProductModelID]
INNER JOIN [Production].[ProductModelProductDescriptionCulture] pmx
ON pm.[ProductModelID] = pmx.[ProductModelID]
INNER JOIN [Production].[ProductDescription] pd
ON pmx.[ProductDescriptionID] = pd.[ProductDescriptionID];