Farily new to SQL and the IT world, and always do a lot of work before asking for help but this time I am stumped.
I have three tables:
So I am trying to update the "payment_owed" table by doing the following: For each customer, get the food_id and quantity, then using the food_id multiply the quantity by the cost.
The best I have done this far is a natural join on the tables, and attempting to sum the quantity * cost for each ID
My understanding for updating a specific customer:
update customer
set payment_owed = (select <quantity>) * (select <cost>)
where cust_no = 1;
If im not on the right forum or there's a better place to ask these questions let me know, thank you for your time!
