64 624
Assignments Done
99,1%
Successfully Done
In September 2018

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;
Expert's answer
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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions