I want to create a shopping cart in an online store. I have two ways to design shopping cart, but I don't know which one is better.
Solution 1: create a table like below :
in this way for each product for a user add new row.
note UserId and ProductId are uniqe
use two tables: shopping cart, cartItem
In this way for each user just create a record in
Shoopingcart Table .
What is your opinion?