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.
Not the most concise solution, but easy to understand, and self-documented:
/*Enter your query here.Please append a semicolon ";" at the end of the query and enter your query in a single line to avoid error.*/WITHfull_view_statsAS(SELECTct.contest_id,ct.hacker_id,ct.name,vs.total_views,vs.total_unique_viewsFROMView_StatsvsJOINChallengeschONvs.challenge_id=ch.challenge_idJOINCollegesclONch.college_id=cl.college_idJOINContestsctONct.contest_id=cl.contest_id),full_submission_statsAS(SELECTct.contest_id,ct.hacker_id,ct.name,ss.total_submissions,ss.total_accepted_submissionsFROMSubmission_StatsssJOINChallengeschONss.challenge_id=ch.challenge_idJOINCollegesclONch.college_id=cl.college_idJOINContestsctONct.contest_id=cl.contest_id),reduced_view_statsAS(SELECTcontest_id,hacker_id,name,SUM(total_views)astotal_views,SUM(total_unique_views)AStotal_unique_viewsFROMfull_view_statsGROUPBYhacker_id,contest_id,name),reduced_submission_statsAS(SELECTcontest_id,hacker_id,name,SUM(total_submissions)astotal_submissions,SUM(total_accepted_submissions)AStotal_accepted_submissionsFROMfull_submission_statsGROUPBYhacker_id,contest_id,name)SELECTss.contest_id,ss.hacker_id,ss.name,(total_submissions),(total_accepted_submissions),(total_views),(total_unique_views)FROMreduced_submission_statsssJOINreduced_view_statsvsONss.hacker_id=vs.hacker_idWHERENOTtotal_submissions=0ORNOTtotal_accepted_submissions=0ORNOTtotal_views=0ORNOTtotal_unique_views=0ORDERBYss.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 →
Not the most concise solution, but easy to understand, and self-documented: