This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with participants as ( | |
select distinct(user_id) as user_id, name as user_name | |
from submissions | |
left join problems p on submissions.problem_id = p.id | |
left join users on users.id = submissions.user_id | |
where p.contest_id = (select max(id) from contests) | |
), problemcount as ( | |
select user_id, count(distinct (problem_id)) as problem_count | |
from users | |
left join submissions on users.id = submissions.user_id |