Apply delivery to stock_levels: existing SKUs get the delivered qty added, new SKUs are inserted. Use the primary key to decide.
delivery
stock_levels
Each hint gives a little more help. Try on your own first.
Run your code to see the output here.