USE DataMiningDW
GO

SELECT AVG([Forecast.Total Amount])
FROM dbo.CrossPrediction
UNION ALL
SELECT AVG([Forecast.Total Amount])
FROM dbo.PredictOnly
GO

SELECT AVG([Forecast.Total Amount])
FROM dbo.CrossPrediction
WHERE [Forecast.$TIME]<200812
UNION ALL
SELECT AVG([Forecast.Total Amount])
FROM dbo.PredictOnly
WHERE [Forecast.$TIME]<200812
GO

SELECT AVG([Forecast.Total Amount])
FROM dbo.CrossPrediction
WHERE [Forecast.$TIME]<200812
UNION ALL
SELECT AVG([Forecast.Total Amount])
FROM dbo.PredictOnly
WHERE [Forecast.$TIME]<200812
UNION ALL
SELECT AVG([Forecast.Total Amount])
FROM dbo.Periodicity
WHERE [Forecast.$TIME]<200812
GO

SELECT AVG([Forecast.Total Amount])
FROM dbo.CrossPrediction
UNION ALL
SELECT AVG([Forecast.Total Amount])
FROM dbo.PredictOnly
UNION ALL
SELECT AVG([Forecast.Total Amount])
FROM dbo.Periodicity
GO

USE AdventureWorksDW
GO

SELECT COUNT(*)
FROM dbo.DimProductSubcategory SC JOIN dbo.DimProductCategory C
ON SC.ProductCategoryKey = C.ProductCategoryKey
WHERE C.EnglishProductCategoryName='Bikes'
GO

