Just wondering what the best database design is for this particular pset.

ATM I have a table for trades which serves to record all transacsatsions (buy and sell), each trade has an unique id, and associates with a user from the users table.

The problem I'm having his how to approach the portfolio section of the site. I could create a portfolio table with user id, symbol, and shares fields. However, it seems a bit redundant, as anything required for the portfolio can be calculated from the trades table. I.e sum of buys and sells of a symbol gives the total owned of that stock. Then do a lookup of the current price, and post that in the portfolio section.

However, that also seems suboptimal.

Anyoen want to share their schema?


You must log in to answer this question.

Browse other questions tagged .