SQL & Queries


Answer & solution
Answer: SELECT DISTINCT a.centr_code FROM appears a JOIN examinee e ON e.regno=a.regno WHERE e.score>80; (no official key was published)
Join each appearance to its examinee using the shared registration number, keep scores strictly greater than 80, then project distinct centre codes:
SELECT DISTINCT a.centr_code
FROM appears AS a
JOIN examinee AS e ON e.regno = a.regno
WHERE e.score > 80;
DISTINCT is important because several high-scoring examinees can share a centre. This is an existential requirement: one qualifying examinee is sufficient. It is not a condition on centre average, and it does not require every examinee at that centre to exceed 80. An equivalent SQL formulation selects DISTINCT centre codes from appears a WHERE EXISTS (SELECT 1 FROM examinee e WHERE e.regno=a.regno AND e.score>80).