CCA159 : Task Scenario-17

Problem Scenario 17:  As you have been given below table.

HADOOPEXAM_STOCK (exchange string, stock_symbol string,  closing_date timestamp, closing_price decimal(8,2))

1. Write a query , which generate report as below.

exchange, stock_symbol , closing_date , closing_price , yesterday_closing , diff_yesterday_price (Price difference between Yesterdays price and todays price)

2. Write a query , which generate report as below.

exchange, stock_symbol , closing_date , closing_price , yesterday_closing , diff_last7days_price (Price difference between last 7days price and todays price)

3. Write a query which will print, whether following day price is higher ,  lower . Output should be like this.

exchange,stock_symbol, closing_date, closing_price, position