there’s a drop down html element for date for the current month (January 1 to January 30), currency (CAD,GBP,USD).
there’s a html table with two columns, hour and price.
part I: how would I create the table in mysql.
I thought about creating two tables. One with columns id, currency. The other table would have columns hour,price,date,currency_id (foreign key). What is the correct solution?
part II:
table has columns: id, market_instrument, price
I came up with. SELECT avg(price) FROM table WHERE market_instrument="";
but the expected result was to get average price for each unique market_instrument. what is the correct SQL query?
To get average price for each unique market_instrument, you need to use
GROUP BY: