Which is a better db design when inserting records?
**Option 1.**
uid|itemid| qty | price | amount
1 |13| 2 | 100 |200
**Option 2.**
uid| itemid| qty | price | amount
1 |13| 1 | 100 | 100
2 |13| 1 | 100 | 100
In option 2 then retrieve rows via mysql query and calculate using id ...
See Question&Answers more detail:os