php - Database structure for stock trading website? -


i have created simple stock trading simulation website. users can sign , buy/sell stocks. now, i've come problem. when use buys stock (can more 1 share), how put database?

this bit of challenge because each user can buy stock exists , can buy quantity.

here's example of i'm trying store db:

stocks owned username1261817

symbol: quantity

goog: 3

yhoo: 8

aapl: 3

etc...

you might have design table how shopping cart do. include fields - userid (comes user table), stock symbol, quantity, stock price @ time of purchase, date purchased. generate necessary reports total stocks of 1 type, total stocks owned user etc.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -