• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE | Gate IT 2008 | Question 72

Student (school-id, sch-roll-no, sname, saddress)
School (school-id, sch-name, sch-address, sch-phone)
Enrolment(school-id sch-roll-no, erollno, examname)
ExamResult(erollno, examname, marks)
What does the following SQL query output? C
SELECT	sch-name, COUNT (*)
FROM	School C, Enrolment E, ExamResult R
WHERE	E.school-id = C.school-id
AND
E.examname = R.examname AND E.erollno = R.erollno
AND
R.marks = 100 AND S.school-id IN (SELECT school-id
                                FROM student
                                GROUP BY school-id
                                 HAVING COUNT (*) > 200)
GROUP By school-id
 /* Add code here. Remove these lines if not writing code */ 

(A)

for each school with more than 200 students appearing in exams, the name of the school and the number of 100s scored by its students

(B)

for each school with more than 200 students in it, the name of the school and the number of 100s scored by its students

(C)

for each school with more than 200 students in it, the name of the school and the number of its students scoring 100 in at least one exam

(D)

nothing; the query has a syntax error

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments