A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

Discussion Forum

Que. 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?

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
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:nothing; the query has a syntax error
Confused About the Answer? Ask for Details Here
Know Explanation? Add it Here

Similar Questions: