Answer to Question #64109 in Databases | SQL | Oracle | MS Access for Skylar Li

Question #64109
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;
1
Expert's answer
2017-04-14T09:19:05-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS