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.
Need help:
I do this, in mysql, and i don't get why is a wrong answer
select con.contest_id, con.hacker_id, con.name, sum(ss.total_submissions), sum(ss.total_accepted_submissions), sum(vs.total_views), sum(vs.total_unique_views)
from contests con
inner join colleges col on con.contest_id = col.contest_id
inner join challenges cha on col.college_id = cha.college_id
inner join view_stats vs on cha.challenge_id = vs.challenge_id
inner join submission_stats ss on cha.challenge_id = ss.challenge_id
group by con.contest_id, con.hacker_id, con.name
having sum(ss.total_submissions) > 0 or sum(ss.total_accepted_submissions)>0 or sum(vs.total_views)>0 or sum(vs.total_unique_views)>0
order by con.contest_id
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 →
Need help: I do this, in mysql, and i don't get why is a wrong answer
select con.contest_id, con.hacker_id, con.name, sum(ss.total_submissions), sum(ss.total_accepted_submissions), sum(vs.total_views), sum(vs.total_unique_views) from contests con inner join colleges col on con.contest_id = col.contest_id inner join challenges cha on col.college_id = cha.college_id inner join view_stats vs on cha.challenge_id = vs.challenge_id inner join submission_stats ss on cha.challenge_id = ss.challenge_id group by con.contest_id, con.hacker_id, con.name having sum(ss.total_submissions) > 0 or sum(ss.total_accepted_submissions)>0 or sum(vs.total_views)>0 or sum(vs.total_unique_views)>0 order by con.contest_id