47 votes 47 votes Consider the following relational schema: $\text{Student} (\underline{\text{school-id}, \text{sch-roll-no}}, \text{sname}, \text{saddress})$ $\text{School} (\underline{\text{school-id}}, \text{sch-name}, \text{sch-address}, \text{sch-phone})$ $\text{Enrolment}(\underline{\text{school-id}, \text{sch-roll-no}}, \text{erollno}, \text{examname})$ $\text{ExamResult}(\underline{\text{erollno}, \text{examname}}, \text{marks})$ Consider the following tuple relational calculus query. $\left\{t \mid \exists E \in \text{Enrolment }\;\; t = E.\text{school-id} \wedge \left | \{x \mid x \in \text{Enrolment} \wedge x.\text{school-id} = t \wedge (\exists B \in \text{ExamResult} \;\;B.\text{erollno} = x.\text{erollno} \wedge B.\text{examname} = x.\text{examname} \wedge B.\text{marks} > 35)\}\right | \div \left | \{x \mid x \in \text{Enrolment} \wedge x.\text{school-id} = t\}\right | * 100 > 35\right\}$ If a student needs to score more than 35 marks to pass an exam, what does the query return? The empty set schools with more than $35\%$ of its students enrolled in some exam or the other schools with a pass percentage above $35\%$ over all exams taken together schools with a pass percentage above $35\%$ over each exam Databases gateit-2008 databases relational-calculus normal + – Ishrat Jahan asked Oct 29, 2014 • edited Aug 20, 2020 by gatecse Ishrat Jahan 15.2k views answer comment Share Follow See all 9 Comments See all 9 9 Comments reply Show 6 previous comments shashankrustagi commented Dec 5, 2020 reply Follow Share Take it as an assignment. Practice it and share your method, I will tell you will it satisfy option d or not. 0 votes 0 votes madhes23 commented Dec 31, 2021 reply Follow Share Before looking at the answer, please note that: $\div$ operator is simple mathematical division, not to be confused with “Division operator in Relational algebra” $| \{query\} |$ indicates the number of tuples returned while executing that query. 5 votes 5 votes gvinay commented Oct 23, 2023 i reshown by gvinay Oct 23, 2023 reply Follow Share @madhes23 you are right 0 votes 0 votes Please log in or register to add a comment.
Best answer 24 votes 24 votes $t \mid \exists E \in \text{Enrolment}\; t = E.\text{school-id}$ Returns school-ids from Enrolment table SUCH THAT $| \{x \mid x \in \text{Enrolment} \wedge x.\text{school-id} = t \wedge (\exists B \in \text{ExamResult}\;\; B.\text{erollno} = x.\text{erollno} \wedge B.\text{examname} = x.\text{examname} ∧ B.\text{marks} > 35)\}| \div$ the number of student enrolments from the school for exams with marks > 35 divides $|\{x \mid x \in \text{Enrolment} \wedge x.\text{school-id} = t\}|$ total number of student enrolments from the school $* 100 > 35$ percentage of student enrolments with mark > 35 is > 35 Since to pass an exam $>35$ mark is needed, this means selecting the school-ids where the pass percentage of students across all the exams taken together is $> 35.$ Correct Answer: C. gatecse answered Aug 20, 2020 • selected Aug 20, 2020 by gatecse gatecse comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments gvinay commented Oct 23, 2023 reply Follow Share In the explaination in place of student number it will be school no. 0 votes 0 votes kirtijyotisenapati commented Jan 17 reply Follow Share Kind of confusing here . What if a student scores passing mark in one exam and does not pass in another exam. So will that be considered as passed or not? Means a student taking 2 exams and he is passing in 1 and that is getting divided against unique school ids to find the pass percentage at the end . Wouldn't it be divided by the total no of exams taken by all the students (not school ids) 0 votes 0 votes caboose commented Feb 6 reply Follow Share the query seems to be more in line with "schools with percentage of students passing atleast one exam > 35" correct me if im wrong 0 votes 0 votes Please log in or register to add a comment.
36 votes 36 votes t | ∃ E ∈ Enrollment t = E.school-id select a school-id from Enrollment table Let | {x | x ∈ Enrollment ^ x.school-id = t ∧ (∃ B ∊ ExamResult B.erollno = x.erollno ∧∧ B.examname = x.examname ∧∧ B.marks > 35)}| be A gives count of enrollments for the selected school-id with exam result having marks > 35 (pass criteria) Let | {x | x ∊ Enrollment ∧ x.school-id = t}| be B gives count of enrollments for the selected school-id So, query selects those school-id with (A/B)*100 > 35. Which in plain english means school-id with pass percentage in all exams taken together > 35%. So ans should be C. Pratik Gawali answered Oct 14, 2018 Pratik Gawali comment Share Follow See all 0 reply Please log in or register to add a comment.
15 votes 15 votes {t | ∃ E ∊ Enrolment t = E.school-id ^ | {x | x ∊ Enrolment ^ x.school-id = t ^ (∃ B ∊ ExamResult B.erollno = x.erollno ^ B.examname = x.examname ^ B.marks > 35)} In this first query it is picking up tuple of the student who Enroll in some exam and who got >35 marks in that exam {x | x ∊ Enrolment ^ x.school-id = t}| * $100 > 35$} in second part of the query t is tuples of first query and x is their enrollment and enrollment $>35$% So, The query returns the tuples where $35$% students enrolled and all of them got $>35$ marks in some exam B) division will pick $35$% enrollment of the student in some exams srestha answered Jul 19, 2016 • edited Jun 29, 2018 by Milicevic3306 srestha comment Share Follow See all 7 Comments See all 7 7 Comments reply sushmita commented Sep 3, 2016 reply Follow Share what is the meaning of | in the above query. I am not able to understand this tuple calculus and its syntax is very ambiguous to me. Can anyone explain?? 5 votes 5 votes gate-17 commented Nov 12, 2016 reply Follow Share I have same doubt please help? 3 votes 3 votes rahul sharma 5 commented Jul 13, 2017 reply Follow Share @Srestha {x | x ∊ Enrolment ^ x.school-id = t}| * 100 > 35} . The last closing braces is not belonging to the denominator as it there is not opening braces in the denominator for the same. I think we will get the result is ((Query1)/Query2) ) /100*35 1 votes 1 votes atul_21 commented Aug 13, 2017 reply Follow Share I don't get thevery simple thing of second query . How the " * 100 > 35 " is giving more than 35%.? Can u plz explain this to me? 0 votes 0 votes prateekdwv commented Dec 1, 2017 reply Follow Share As per the question, we are asked to assume that students need more than 35 marks to pass in an examination. With this in mind, isn't option(c) more appropriate? 1 votes 1 votes Ramij commented Jul 5, 2018 reply Follow Share what is the answer please elaborate correctly 1 votes 1 votes ShubhamLahoti commented Nov 13, 2019 reply Follow Share What if hypothetically, all the schools in which 35% students enrolled and all of them got less than 35 marks? From option B, those schools should be printed in output, but should they actually be printed? 0 votes 0 votes Please log in or register to add a comment.
5 votes 5 votes query having division with {x | x ∊ Enrolment ^ x.school-id = t}| * 100 > 35}. school with enrollment % is 35 or above .. Digvijay Pandey answered May 3, 2015 • edited Jul 1, 2015 by Digvijay Pandey Digvijay Pandey comment Share Follow See all 2 Comments See all 2 2 Comments reply amkrj commented May 5, 2015 reply Follow Share what is x in the given question . plz. make it clear 0 votes 0 votes Satyam Rohela commented Aug 13, 2017 reply Follow Share How this " * 100 > 35" is giving 35% . I'm not getting it.Plz explain. 1 votes 1 votes Please log in or register to add a comment.