Relational-Calculus

Question 1

Which of the following relational calculus expressions is not safe?

A
{t|∃u ∈ R1 (t[A] = u[A])∧ ¬∃s ∈ R2 (t[A] = s[A])}
B
{t|∀u ∈ R1 (u[A]= "x" ⇒ ∃s ∈ R2 (t[A] = s[A] ∧ s[A] = u[A]))}
C
{t|¬(t ∈ R1)}
D
{t|∃u ∈ R1 (t[A] = u[A])∧ ∃s ∈ R2 (t[A] = s[A])}
Question 2

Consider the following relational schema:

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:

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 its students 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
Question 2 Explanation: 
Query having the division with
{ x | x ∈ Enrollment ∧ x . school-id = t } | * 100 > 35 }
This is school with enrollment % is 35 or above.
As we are actually taking percentage of
(Total count in which a student has passed from a particular school)/(Total exams taken by all student combined)
Eg: if A passed in 3 and B passed in 4 and they both took 5-5 exam each. Then it is (7/10)
Question 3

Which of the following tuple relational calculus expression(s) is/are equivalent to ∀t ∈ r(P(t))?

    I. ¬∃t ∈ r(P(t))
    II. ∃t ∉ r(P(t))
    III. ¬∃t ∈ r(¬P(t))
    IV. ∃t ∉ r(¬P(t))
A
I only
B
II only
C
III only
D
III and IV only
Question 3 Explanation: 
Demorgan law:
∀xP(x) ≡ ∼∃x(∼P(x))
∼∀x(∼P(x)) ≡ ∃x(P(x))
Given: ∀t ∈ r(P(t))------ (1)
As per Demorgan law
(1) ⇒ ∼∃t ∈ r(∼P(t))
which is option (III).
There are 3 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access