Query 1: For each Symbol starting with the letter "A" compute the lowest and highest trade price every minute for all trades between 9:30am and 4:00pm
Here is my code so far, just need to know how to do the "every minute" part.
SELECT MAX(trade_price) AS HighestPrice, MIN(trade_price) AS LowestPrice
FROM trades_full
WHERE symbol LIKE 'A%'
AND HOUR(trading_date_time) BETWEEN 9.30 AND 16;
We don't understand any of semantic sense of «every minute» too.
But in general it'll be somewhat like this:
SELECT MAX(trade_price) AS HighestPrice, MIN(trade_price) AS LowestPrice
FROM trades_full
WHERE symbol LIKE 'A%'
AND HOUR(trading_date_time) BETWEEN 9.30 AND 16
GROUP BY MINUTE(trading_date_time)
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!