Just a quick observation on your schema. All of the tables, except stock, have a date field so I guess you are saving these points as a time series. On the stock table you have market cap but no date. Market cap changes over time so don't you need to have a separate table for stock code, market...