Consider The Following Relational Scheme Student (school-id, sch-roll-no,…
2008
Consider The Following Relational Scheme
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)
Consider the following tuple relational calculus query
{ t | ∃E ∈ Enrolment t = E.school-id ∧
| { x | x ∈ ExamResult B.school-id =
t ∧ ( ∃B ∈ ExamResult B.erollno =
x.erollno ∧ B.examname = x.examname ∧
B.marks > 35 } | ÷ |
{ x | x ∈ Enrolment ∧ x.school-id = t }
| * 100 > 35 }If a student needs to score more than 35 marks to pass an exam what does the query return?
- A.
The empty set
- B.
Schools with more than 35% of it's student enrolled in some exam or the other
- C.
Schools with a pass percentage above 35% over all exams taken together
- D.
Schools with a pass percentage above 35% over each exam.
Attempted by 13 students.
Show answer & explanation
Correct answer: C
Answer: The query returns school identifiers for which the overall pass percentage (across all exams combined) is greater than 35%.
Reasoning:
The variable t ranges over school identifiers for which there exists an enrollment row (so the school has enrollments).
The denominator set is the set of Enrolment tuples for that school (all enrolled students/exam registrations for school t).
The numerator set counts ExamResult entries that correspond to those enrollments and satisfy marks > 35. ExamResult does not need a school-id because it is associated to a school by joining through Enrolment using erollno and examname.
The expression then computes (number of passed results for the school) / (number of enrollments for the school) * 100 and checks whether this percentage is greater than 35.
Therefore the query returns schools whose overall pass rate (across all exams combined) exceeds 35%. It is not asking for the percentage of students merely enrolled in exams, nor is it requiring >35% pass rate in each individual exam.