I'm running a point-of-sale system for a pharmacy but I have a problem. I hope you can help me!

-1

So far in my program I do the product registration in which the cost, the stock and all that data are already found.

But what I can not do is that every sale that is registered is stored in the same database. How can I relate the tables so that in the sales table you can enter the id of the product and thus be able to take the cost of the product and some more data. I would greatly appreciate your help.

I am developing the project in Java with the IDE Netbeans and the database is MySQL since WampServer

    
asked by kenn 27.04.2018 в 20:18
source

1 answer

0

To be able to do what you want, you will need to create two additional tables in addition to products , an example would be.

Where the sale table will save all the data you need from the sale, whether it's time, date, etc. And the sale_file table will serve to save all the products you need to register for the same sale . By doing it this way you can register all the products at the same time, instead of having to repeat the process for each product you need to sell.

    
answered by 27.04.2018 в 21:10