I have been able to select this data, using these two sql queries

[![enter image description here](https://i.stack.imgur.com/d73s2.png)](https://i.stack.imgur.com/d73s2.png)

Query 1:

```
SELECT article_id, amount_required, amount_sold FROM products_articles,sales WHERE sales.product_id = products_articles.product_id

```

Query 2:

```
SELECT * FROM articles

```

What I want to do, is go through the first table (with amount sold and required) (it's fine that there are duplicate rows), and for each row in the table multiply the value of amount\_sold and amount\_required and then subtract that value from amount\_in\_stock where the ids match in the second table.

Example from the first row:
2 \* 4 = 8, change amount\_in\_stock from 124 to 116.
And so on...

How can I do this using just sql?