If two tables: A product containing information about the goods; and an Order table containing product codes and their quantities. How to subtract one from the other? What should the query look like? 
That's what I came up with, but it doesn't work. Unknown Orders_has_Goods.Goods_id_goods column in a where clause
update mall.Goods set Goods.amount = Goods.amount - Orders_has_Goods.quantity where Goods.id_goods = Orders_has_Goods.Goods_id_goods;