My portfolio table has fields user_id,Name,Symbol,Shares,Price,Total,Datetime showing who bought what at what price & when aka a record of all users buying their stocks. Now, if there is a user say Andi. Andi buys 3 shares of NFLX and then buys another 4 shares of NFLX my portfolio shows two rows for Andi with her user_id showing 3 shares for NFLX with dattime and second row for 4 shares of NFLX with datetime. Now, if she wants to sell 2 shares of NFLX should I make another table showing all shares that she wants to sell with datettime? Whereas if I update portfolio table by changing in first row the shares from 3 to 1 or in second row changing shares from 4 to 2 either seems absurd to me because we are changing the original purchase data of the user.Whereas in the walkthrough Zamyla says to go for removing the stock from user's portfolio via two ways : 1.DELETE FROM or 2.log scale as a negative quantity.
Plse excuse for such a long post but I am stuck over this question for long! Any suggestions will be appreciated!