Query description: hist_qry1 Get the closing price of a set of 10 stocks for a 10-year period and group into weekly, monthly, and yearly aggregates. For each aggregate period, determine the low, high, and average closing price value. The output is sorted by TRADING_SYMBOL and trade date.
TRADING_SYMBOL YEAR MON WEEK MAX_PRICE MIN_PRICE AVG_PRICE AAA 2005 2 7 26.24 25.48 25.925 AAA 2005 2 8 26.49 25.46 25.972 AAA 2005 2 9 27.28 26.48 26.746 AAA 2005 2 10 26.47 26.47 26.47 AAA 2005 2 (NULL) 27.28 25.46 26.25066667 AAA 2005 3 10 26.46 25.93 26.2625 AAA 2005 3 11 26.19 24.9 25.566 AAA 2005 3 12 26.16 25.38 25.792 AAA 2005 3 13 25.38 24.37 24.924 AAA 2005 3 14 25.61 25.11 25.36 AAA 2005 3 (NULL) 26.46 24.37 25.56086957 AAA 2005 4 14 25.87 25.87 25.87 AAA 2005 4 15 26.39 25.34 25.866 AAA 2005 4 16 26.1 25.07 25.634 AAA 2005 4 17 25.81 24.81 25.314 AAA 2005 4 18 27.94 26.59 27.284 AAA 2005 4 (NULL) 27.94 24.81 26.01714286 AAA 2005 5 19 27.1 26.55 26.828 AAA 2005 5 20 27.08 26.29 26.71 AAA 2005 5 21 27.08 26.54 26.862 AAA 2005 5 22 28.45 27.07 27.836 AAA 2005 5 23 27.88 27.6 27.74 AAA 2005 5 (NULL) 28.45 26.29 27.12090909 AAA 2005 6 23 27.05 26.24 26.69 ...
The hist_qry1 query uses the ROLLUP operator.
The NULL values for month and week are subtotals. A NULL value in
the week column is a subtotal for the month. A NULL value in the
month and week columns is a subtotal for the year.
Query description: hist_qry4 Calculate the value of the S&P 500 and Russell 2000 index for a specified day using unadjusted prices and the index composition of the two indexes on the specified day.
INDEX_NAME AVERAGE_CLOSE_PRICE Russell 2000 49.47026052 S&P 500 54.44644
Query description: hist_qry7 Determine the value of $100,000 now if 1 year ago it was invested equally in 10 specified stocks (that is, allocation for each stock is $10,000). The trading strategy is: When the 20-day moving average crosses over the 5-month moving average, the complete allocation for that stock is invested, and when the 20-day moving average crosses below the 5-month moving average, the entire position is sold. The trades are made on the closing price of the trading day.
STOCK_VALUE 289690.0039