title: How to sum price of products in cart per user
body: <p>I'm trying to move some logics of my web shop application to database engine, so I figured that counting price of cart would be a good start. So I have a relation shown below with Cart_product table having foreign keys with Buyer and Product. The total price of cart for each user would be the price of each product in Cart_product multiplied by it's amount.
  How and with what can I achieve this ? Trigger, procedure, cursor ? Any help appreciated. </p>
  
  <p><img src="https://i.stack.imgur.com/k1uW9.png" alt="enter image description here"></p>