标记表条目不会在选择/使用该行条目后再次显示

I am a beginner in programming and I don't know if my title suits my issue, but here is what I am dealing with:

I made a simple inventory program. I can insert, edit and delete entries and it all works perfect. For my next challenge I need to make it that when an item gets sold out of the inventory that my database will flag that entry so that it will not show again in that list in the application. (Makes sense right? when u sell a product it can't still be there cuz its sold)

But since I am a beginner I have no idea whats o ever how to research this cuz I have never done this before! That's why its a challenge :)

Can you pls tell me what I should research to learn about how I should be doing this ? Thank you in advanced for ur advice and attention! And my apologies if this question is off-topic to this website but I don't know where else to ask since this website is so awesome! Cheers

If products are coming INTO your inventory you would need to scan the products and the amount of how much has come in right? When you do this for a product you would just update the record with the ID of the product that has come in(By scanning the product you should get the ID I assume) and the update query could look something like this:

UPDATE myTable SET productStock=productStock+amount* WHERE productID = ID* 

*Amount stands for the amount that came INTO your inventory.

*ID stands for the ID of the product.

The above was an intro, now your question which you can lead off of the above, when a customer wants your product, and clicks on it, orders it, you can do the UPDATE query again, but now MINUS 1 or whatever the amount the customer orders(again by doing multiple amounts you should always check if you have it in stock, but that's another part)

UPDATE myTable SET Stock=Stock-amount* WHERE productID = *ID

*Amount now stands for the amount that the customer orders OUT OFF your inventory.

*ID stands for the ID of the product.

When your "productStock" turns 0, you could simply modify or add a query which will only show values where the "productStock" IS NOT 0.

Example:

SELECT * FROM products WHERE productStock <>* 0;

*<> This symbol stands for NOT EQUAL and in some versions of SQL this is written as !=

Hopefully this would help you on your way.

EDIT:

Why you should not 'flag' or 'remove' the product out of your DB is because when it returns you don't have to fill in the entire product again...