DROP VIEW IF EXISTS total_offer_deliveries_view;
CREATE VIEW total_offer_deliveries_view (
 offer_id,
 total_quantity
) as
SELECT 
    offer_id ,
    sum(offer_deliveries.quantity) as total_quantity 
FROM offer_deliveries 
GROUP by offer_id;