I’m working with the newbie databases and this is what I can’t figure out. The headline probably didn’t make up correctly, but the point is
there is a table of orders
it has an idCake column - the id of the cake that was ordered, it also has a confirm column, so when I press the 'confirm order' button on the front, I change 0 to 1 and run the function that makes the query in table 2 which has fields with cake id and product id
As a result, I have an array of objects. I understand it will be something like [{id: 1, quantity200}, {id: 2, quantity2}] - how many ingredients do you need to write off from table 3 (warehouse)
And then there were 2 questions - according to the correct logic, I structure the work of the back-up and how is it more correct to write off the ingredients from the warehouse (just to put an array into a cycle and make many small queries or do you need to make one big request?)



Weghtmean in the order table? - Alex78191