Skip to content

Commit 870905d

Browse files
authored
Merge pull request #37 from topcoder-platform/feature/tco21-data-science-tag-addition
Added query to map challenges to data science code tag
2 parents fc4f7e4 + 2a721a6 commit 870905d

File tree

1 file changed

+118
-2
lines changed

1 file changed

+118
-2
lines changed

tco_setup/tco21_eligible_contests.sql

Lines changed: 118 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ WHERE p.project_status_id = 1
398398

399399
-- MM
400400
--As per community team, Challenges tagged with Data Science are removed from Marathon Match tag.
401-
--They will not be counted for any leaderboards for tco20
401+
--They will be counted for data science leaderboards for tco21
402402

403403
-- Stage 1
404404
insert into contest_project_xref
@@ -505,4 +505,120 @@ WHERE p.project_status_id = 1
505505
-- and mod(p.project_id, 2) = 0
506506
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
507507
-- and p.project_id not in (30129332) --excluding practice contest
508-
and 1 = 1;
508+
and 1 = 1;
509+
510+
511+
-- Data Science
512+
--As per community team, Challenges with category code and tagged with Data Science
513+
--are only counted in Data Science leaderboard
514+
515+
--Stage 1
516+
517+
insert into contest_project_xref
518+
SELECT 733, p.project_id, current
519+
FROM project p
520+
INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id = 1 and
521+
pp.actual_start_time >= '2020-07-01 00:00:00.000' and pp.actual_start_time < '2020-10-01 00:00:00.000'
522+
INNER JOIN project_info pi12 ON p.project_id = pi12.project_id and pi12.project_info_type_id = 12 and pi12.value = 'Yes'
523+
INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_info_type_id = 14 and pi14.value = 'Open'
524+
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
525+
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
526+
WHERE p.project_status_id = 1
527+
and
528+
--(
529+
p.project_category_id in (39) -- include code matches always
530+
and
531+
exists (SELECT 1 FROM comp_technology
532+
WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212) -- to check if the challlenge is tagged as Data Science
533+
--)
534+
and p.project_id not in (select project_id from contest_project_xref where contest_id in (733,732)) -- make sure we exclude from tco
535+
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
536+
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
537+
and p.tc_direct_project_id not in ( 22249 ) --Rodeo Challenges to be excluded
538+
-- and mod(p.project_id, 2) = 0
539+
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
540+
and 1 = 1;
541+
542+
543+
--Stage 2
544+
545+
insert into contest_project_xref
546+
SELECT 734, p.project_id, current
547+
FROM project p
548+
INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id = 1 and
549+
pp.actual_start_time >= '2020-10-01 00:00:00.000' and pp.actual_start_time < '2021-01-01 00:00:00.000'
550+
INNER JOIN project_info pi12 ON p.project_id = pi12.project_id and pi12.project_info_type_id = 12 and pi12.value = 'Yes'
551+
INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_info_type_id = 14 and pi14.value = 'Open'
552+
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
553+
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
554+
WHERE p.project_status_id = 1
555+
and
556+
--(
557+
p.project_category_id in (39) -- include code matches always
558+
and
559+
exists (SELECT 1 FROM comp_technology
560+
WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212) -- to check if the challlenge is tagged as Data Science
561+
--)
562+
and p.project_id not in (select project_id from contest_project_xref where contest_id in (734,732)) -- make sure we exclude from tco
563+
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
564+
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
565+
and p.tc_direct_project_id not in ( 22249 ) --Rodeo Challenges to be excluded
566+
-- and mod(p.project_id, 2) = 0
567+
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
568+
and 1 = 1;
569+
570+
571+
--Stage 3
572+
573+
insert into contest_project_xref
574+
SELECT 735, p.project_id, current
575+
FROM project p
576+
INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id = 1 and
577+
pp.actual_start_time >= '2021-01-01 00:00:00.000' and pp.actual_start_time < '2021-04-01 00:00:00.000'
578+
INNER JOIN project_info pi12 ON p.project_id = pi12.project_id and pi12.project_info_type_id = 12 and pi12.value = 'Yes'
579+
INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_info_type_id = 14 and pi14.value = 'Open'
580+
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
581+
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
582+
WHERE p.project_status_id = 1
583+
and
584+
--(
585+
p.project_category_id in (39) -- include code matches always
586+
and
587+
exists (SELECT 1 FROM comp_technology
588+
WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212) -- to check if the challlenge is tagged as Data Science
589+
--)
590+
and p.project_id not in (select project_id from contest_project_xref where contest_id in (735,732)) -- make sure we exclude from tco
591+
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
592+
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
593+
and p.tc_direct_project_id not in ( 22249 ) --Rodeo Challenges to be excluded
594+
-- and mod(p.project_id, 2) = 0
595+
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
596+
and 1 = 1;
597+
598+
599+
--Stage 4
600+
601+
insert into contest_project_xref
602+
SELECT 736, p.project_id, current
603+
FROM project p
604+
INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id = 1 and
605+
pp.actual_start_time >= '2021-04-01 00:00:00.000' and pp.actual_start_time < '2021-07-01 00:00:00.000'
606+
INNER JOIN project_info pi12 ON p.project_id = pi12.project_id and pi12.project_info_type_id = 12 and pi12.value = 'Yes'
607+
INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_info_type_id = 14 and pi14.value = 'Open'
608+
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
609+
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
610+
WHERE p.project_status_id = 1
611+
and
612+
--(
613+
p.project_category_id in (39) -- include code matches always
614+
and
615+
exists (SELECT 1 FROM comp_technology
616+
WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212) -- to check if the challlenge is tagged as Data Science
617+
--)
618+
and p.project_id not in (select project_id from contest_project_xref where contest_id in (736,732)) -- make sure we exclude from tco
619+
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
620+
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
621+
and p.tc_direct_project_id not in ( 22249 ) --Rodeo Challenges to be excluded
622+
-- and mod(p.project_id, 2) = 0
623+
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
624+
and 1 = 1;

0 commit comments

Comments
 (0)