Book Contents

Book Index

Next Topic

Home

stock_query_07

Query

---------------------------------------------------------------------

----- Query # 07

-- For each stock in a specified list of 1000 stocks, find the

-- differences between the daily high and daily low on the day of

-- each split event during a specified period.

---------------------------------------------------------------------

SELECT A.High_Price - A.Low_Price,

A.Close_Price,

C.Split_Date

FROM StockTransaction_Fact A,

Stock_Dimension B,

Split_Dimension C,

Date_Dimension D

WHERE A.Stock_Key = B.Stock_Key

AND B.split_Key = C.Split_Key

AND A.Date_Key = D.Date_Key

AND D.Calendar_Year = 2002

AND D.Calendar_Week_Number_in_Year = 10

AND D.Day_of_Week = 'Monday'

ORDER BY A.Stock_Key;