For items that are purchased, you should have an order(s) table and an order_items
table. The order id, item id and quantity of each item in each order goes in the order_items
table.
Stock can go up or down for reasons other than stock received and purchases - loss, breakage, samples given out, replacement items sent, items returned that are usable and returned to stock, ... These should be recorded in the stock table, along with stock received.
To get the current stock for any item id(s), you would get the SUM() of the +/- quantity in the stock table and UNION this with negative SUM() the quantity from the order_items
table.
Example query -
select item_id, sum(qty) qty from (
select item_id, sum(quantity) qty from stock WHERE item_id IN(1,2) group by item_id
union all
select item_id, -sum(quantity) qty from order_items WHERE item_id IN(1,2) group by item_id
) x group by item_id