CREATE VIEW test_suite_success_and_failed_rate AS
SELECT
t.uniform_resource_id,
t.name AS suite_name,
t.created_by,
t.created_at,
t.id as suite_id,
sum(c.test_case_count) AS total_test_case,
sum(c.success_status_count) AS success_count,
(sum(c.test_case_count) - sum(c.success_status_count)) AS failed_count
FROM
test_suites t
LEFT JOIN
test_cases_run_status c ON t.id = c.suite_id
GROUP BY suite_id