DROP VIEW IF EXISTS article_score_tasks_view;
CREATE VIEW article_score_tasks_view (
 offer_participant_delivery_id,
 avg_score
) as
SELECT
        `offer_participant_delivery_id`,
        AVG(score) AS `avg_score`
    FROM
        `articles`
    INNER JOIN `article_comment_score` ON articles.id = article_comment_score.article_id
    GROUP BY
        `offer_participant_delivery_id`;