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.
select a.contest_id, a.hacker_id,a.name,b.totsubs,b.totaccptd,a.totalviews,a.uniqueviews
from (select a.contest_id, a.hacker_id,a. name,sum(d.total_views) as totalviews,sum(d.total_unique_views) as uniqueviews
from Contests a
join Colleges b on a.contest_id=b.contest_id
left join Challenges2 c on b.college_id=c.college_id
left join View_Stats d on c.challenge_id=d.challenge_id
group by a.contest_id,a.hacker_id,a. name )a
join (select
a.contest_id, a.hacker_id,a. name,sum(e.total_submissions)totsubs,sum(e.total_accepted_submissions)as totaccptd
from Contests a
join Colleges b on a.contest_id=b.contest_id
left join Challenges2 c on b.college_id=c.college_id
right join Submission_Stats e on c.challenge_id=e.challenge_id
group by a.contest_id,a.hacker_id,a. name) b
on a.contest_id=b.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 →
select a.contest_id, a.hacker_id,a.name,b.totsubs,b.totaccptd,a.totalviews,a.uniqueviews from (select a.contest_id, a.hacker_id,a. name,sum(d.total_views) as totalviews,sum(d.total_unique_views) as uniqueviews from Contests a join Colleges b on a.contest_id=b.contest_id left join Challenges2 c on b.college_id=c.college_id left join View_Stats d on c.challenge_id=d.challenge_id group by a.contest_id,a.hacker_id,a. name )a join (select a.contest_id, a.hacker_id,a. name,sum(e.total_submissions)totsubs,sum(e.total_accepted_submissions)as totaccptd from Contests a join Colleges b on a.contest_id=b.contest_id left join Challenges2 c on b.college_id=c.college_id right join Submission_Stats e on c.challenge_id=e.challenge_id group by a.contest_id,a.hacker_id,a. name) b on a.contest_id=b.contest_id