1.4k views

Which of the rational calculus expression is not safe?

1. $\left\{t \mid \exists u \in R_1\left(t[A] = u[A]\right) \land \neg \exists s \in R_2 \left(t[A] = s[A]\right)\right\}$
2. $\left\{ t \mid \forall u \in R_1\left(u[A]="x" \Rightarrow \exists s \in R_2\left(t[A] = s[A] \land s[A] = u[A]\right)\right) \right\}$
3. $\left\{t \mid \neg (t \in R_1)\right\}$
4. $\left\{t \mid \exists u \in R_1\left(t[A]=u[A]\right) \land \exists s \in R_2 \left(t[A] = s[A]\right)\right\}$

edited | 1.4k views
0
Should the variable t not bounded to a relation as well ? If it is not bounded to a relation then shouldn't t yield infinite no. of tupples in A,B and D. From what I have read the notation followed is { t | R(t) ^ <set of conditions> } .
0

Someone please explain how to read Queries 1, 2 and 3. Are they from TRC or DRC and how to interpret them in some English language!

0

.....

+1
Does not help at all !!!

It returns tuples not belonging to R1 (which is infinitely many). So, it is not safe.

answered by Boss (34.1k points)
selected
0
it is unsafe because of infinite cardinality or inability to show all output ??
m not getting meaning of safe expression.
+2
Safe expressions will give you definite number of tuples.
0
Can anyone give example of unsafe expression in any context / schema which does not involve negation to yield infinite tuples? I am searching for one such. Is this even possible? @Arjun sir?
+5

Consider a relational schema R1 and generally it can take infinite values if domains of attributes aren't restricted.So for any finite instances of relation {t∣¬(tR1)}  will generate instance with infinite tuples so it is unsafe.

eg. R1(Roll Number, Marks) and consider domain of Roll number +ve integers. restriction on marks doesn't matter.

consider a instance of R1

R1
Roll Number Marks
1       22
2        78

now this {t∣¬(tR1)} will generate all possible value that can be in roll number and Marks exclusing (1,22) and (2,78). That will be infinite so this query is unsafe.

both a) and c) should be true....can someone plz explain the correct answer
answered by Active (1.3k points)
+10
A) A is not unsafe, because we have intersection with R1, so at max we can get all tuples from R1. There is no such restriction in C. So A is not answer
!

1
2