GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 21(c)

List centres with a high scorer

Database Management Systems · SQL & Queries · Full GATE CSE 2001 paper

GATE 2001, Q21(c) Descriptive
Report issue

SQL & Queries

Question 21(c), GATE 2001: examinee(regno,name,score) and appears(regno,centr_code). List centre codes having an examinee whose score exceeds 80.
Question 21(c), GATE 2001: examinee(regno,name,score) and appears(regno,centr_code). List centre codes having an examinee whose score exceeds 80.
Tap to enlarge
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).

Original paper, page 10