We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The results are wrong and i dont know where the issue is, any help to put me on the right track will be appriciated:
select c.contest_id,c.hacker_id,c.name,sum(s.total_submissions)as total_sub ,sum(s.total_accepted_submissions) as total_acc,
sum(v.total_views)as total_v,sum(v.total_unique_views)as total_uv
from contests c
left join colleges co on c.contest_id = co.contest_id
left join challenges ch on co.college_id = ch.college_id
left join view_stats v on ch.challenge_id = v.challenge_id
left join submission_stats s on ch.challenge_id = s.challenge_id
group by c.contest_id,c.hacker_id,c.name
having total_sub > 0 or
total_acc > 0 or
total_v > 0 or
total_uv > 0
order by c.contest_id asc
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Interviews
You are viewing a single comment's thread. Return to all comments →
The results are wrong and i dont know where the issue is, any help to put me on the right track will be appriciated: select c.contest_id,c.hacker_id,c.name,sum(s.total_submissions)as total_sub ,sum(s.total_accepted_submissions) as total_acc, sum(v.total_views)as total_v,sum(v.total_unique_views)as total_uv from contests c left join colleges co on c.contest_id = co.contest_id left join challenges ch on co.college_id = ch.college_id left join view_stats v on ch.challenge_id = v.challenge_id left join submission_stats s on ch.challenge_id = s.challenge_id group by c.contest_id,c.hacker_id,c.name having total_sub > 0 or total_acc > 0 or total_v > 0 or total_uv > 0 order by c.contest_id asc