i have a problem with database. I have two tables. one is a table for products with id, name and quantity columns and the second is the sales table, with columns buyer_id, product_name and product_quantity.
My question is,how can, when I enter a product_quantity in the sales table, the same quantity is reduced in the product table?
Just like stock in a warehouse when goods are sold the balance is reduced.