-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDim_Product.sql
More file actions
46 lines (46 loc) · 1.4 KB
/
Dim_Product.sql
File metadata and controls
46 lines (46 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
-- Cleansed DIM_Products Table--
SELECT
p.[ProductKey],
p.[ProductAlternateKey] AS ProductItemCode,
--[ProductSubcategoryKey],
--[WeightUnitMeasureCode],
--[SizeUnitMeasureCode],
p.[EnglishProductName] AS [Product Name],
ps.EnglishProductSubcategoryName AS [Sub Category],
pc.EnglishProductCategoryName AS [Product Category],
--[SpanishProductName],
--[FrenchProductName],
--[StandardCost],
--[FinishedGoodsFlag],
p.[Color] AS [Product Color],
--[SafetyStockLevel],
--[ReorderPoint],
--[ListPrice],
p.[Size] AS [Product Size],
--[SizeRange],
--[Weight],
--[DaysToManufacture],
p.[ProductLine] AS [Product Line],
--[DealerPrice],
--[Class],
--[Style],
p.[ModelName] AS [Product Model Name],
--[LargePhoto],
p.[EnglishDescription] AS [Product Description],
--[FrenchDescription],
--[ChineseDescription],
--[ArabicDescription],
--[HebrewDescription],
--[ThaiDescription],
--[GermanDescription],
--[JapaneseDescription],
--[TurkishDescription],
--[StartDate],
--[EndDate],
ISNULL (p.Status, 'Outdated') AS [Product Status]
FROM
[dbo].[DimProduct] AS p
LEFT JOIN dbo.DimProductSubcategory AS ps ON ps.ProductSubcategoryKey = p.ProductSubcategoryKey
LEFT JOIN dbo.DimProductCategory AS pc ON pc.ProductCategoryKey = pc.ProductCategoryKey
ORDER BY
p.ProductKey ASC