creating an inventory management system app
and the product sold as a negative value


I personally wouldn't do this - it does not reflect reality. You can't have -25 widgets. You can have 10 in an inventory table and 15 in an orders (active) and/or sold (completed orders) table. You can have negative numbers - your bank account can have -25€ - this makes sense.

Take a look at http://www.databaseanswers.org/data_models/ for example inventory designs. -  Vérace



Your scheme has joining rings, it is excessive, and data may be inconsistent. It is possible to have a joined record pair with purshases.purshaseid = inventory.purshaseid and purshases.productid &lt;&gt; inventory.productid.

I think purshases.productid is excess and must be removed. Its value must be selected from joined record in inventory table. And the same with inventory-product-orders ring. - Akina