title: Storing stock portfolio in relational database?
body: <p>I haven't done any major database work since university(10+ years ago) and wasn't sure the best approach to take when designing a database to hold portfolio.</p>
  
  <p>The number of stocks in a portfolio is fixed(30 for example) but there's many portfolio I have. At first I thought I would create a unique ID thats the primary key and then a column for each stock name and the weight(I don't need to store information about the stocks such as price, if needed I can use the name to look that information up). I'm not sure if this is the best approach or if there's a better design?</p>
  
  <p>I have two tables, one will have a current list of portfolio and another will have a historical version(both same format) and I'll compare them row by row and item by item to find similarities and other classifications. Initially I thought of just having a unique ID and then putting all the text of the stock information {IBM:3,goog:10,c:2}, but I'm not sure if parsing the text is effective or if maybe the database can do something to make parsing unnecessary.</p>
  
  <p>I'm a bit new and am reviewing my SQL books but if anyone has any specific insight or anything I should be looking up/reading then that would be great.</p>