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 clg.contest_id,
sum(total_submissions) ts,
sum(total_accepted_submissions) tas
from colleges clg
join challenges c on clg.college_id = c.college_id
join submission_stats st on st.challenge_id = c.challenge_id
group by clg.contest_id
),
views as (
select clg.contest_id,
sum(total_views) tv,
sum(total_unique_views) tuv
from view_stats vt
join challenges c on c.challenge_id = vt.challenge_id
join colleges clg on clg.college_id = c.college_id
group by clg.contest_id
)
/Main combining select/
select c.contest_id,
c.hacker_id,
c.name,
cd.ts,
cd.tas,
v.tv,
v.tuv
from contests c
join challenge_data cd on cd.contest_id = c.contest_id
join views v on v.contest_id = c.contest_id
order by c.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 →
with challenge_data as (
),
views as (
)
/Main combining select/
select c.contest_id,
from contests c join challenge_data cd on cd.contest_id = c.contest_id join views v on v.contest_id = c.contest_id order by c.contest_id