-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDIM_PRODUCT.sql
More file actions
48 lines (48 loc) · 1.49 KB
/
DIM_PRODUCT.sql
File metadata and controls
48 lines (48 loc) · 1.49 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
47
48
--Cleansed DimProduct Table
SELECT
p.[ProductKey],
p.[ProductAlternateKey] AS ProdectItemCode,
--,[ProductSubcategoryKey]
--,[WeightUnitMeasureCode]
--,[SizeUnitMeasureCode]
p.[EnglishProductName] AS ProductName,
ps.EnglishProductSubcategoryName AS SubCategory,
--Joined in from Sub Category Table
pc.EnglishProductCategoryName AS ProductCategory,
--Joined in from Category Table
-- ,[SpanishProductName]
--,[FrenchProductName]
--,[StandardCost]
--,[FinishedGoodsFlag]
p.[Color] AS ProductColor,
--,[SafetyStockLevel]
--,[ReorderPoint]
--,[ListPrice]
p.[Size] AS ProductSize,
--,[SizeRange]
--,[Weight]
--,[DaysToManufacture]
p.[ProductLine] AS ProductLine,
--,[DealerPrice]
--,[Class]
--,[Style]
p.[ModelName] AS ProductModelName,
--,[LargePhoto]
p.[EnglishDescription] AS ProductDescription,
--,[FrenchDescription]
--,[ChineseDescription]
--,[ArabicDescription]
--,[HebrewDescription]
--,[ThaiDescription]
--,[GermanDescription]
--,[JapaneseDescription]
--,[TurkishDescription]
--,[StartDate]
--,[EndDate]
Isnull (p.[Status], 'Outdated') AS ProductStatus
FROM
[AdventureWorksDW2019].[dbo].[DimProduct] AS p
Left join [AdventureWorksDW2019].[dbo].[DimProductSubcategory] as ps on ps.ProductSubcategoryKey = p.ProductSubcategoryKey
Left join [AdventureWorksDW2019].[dbo].[DimProductCategory] as pc on ps.ProductCategoryKey = pc.ProductCategoryKey
Order by
p.ProductKey asc