DROP VIEW IF EXISTS copy_space_project_list_view;
CREATE VIEW copy_space_project_list_view (
 project_id,
 copyscape_cost_project
) as 
SELECT
    `topics`.`project_id`,
    ROUND(
        COALESCE(
            SUM(
                articles.copyscape_cost_project
            ),
            0
        ),
        2
    ) AS `copyscape_cost_project`
FROM
    `topics`
INNER JOIN `offer_participant_deliveries` ON offer_participant_deliveries.topic_id = topics.id
INNER JOIN `articles` ON articles.offer_participant_delivery_id = offer_participant_deliveries.id
GROUP BY
    `topics`.`project_id`;