# Database-TRC and RA

124 views
Consider two relation schemas

$R(A,B,C)$ and $S(D,E,F)$

Give an expression in the tuple relational calculus that is equivalent to each of the following.

(a)$\pi_A(r)$ ->$\{t|t \in r\land t[A]=r[A]\}$

(b)$\sigma_{B=17}(r)$-$\{t|t \in r \land t[B]=17\}$

(c)$r \times s$-->$\{t| \exists t_1 \in r \land \exists t_2 \in s \land t[A]=t_1[A] \land t[B]=t_1[B] \land t[C]=t_1[C] \land t[D]=t_2[D] \land t[E]=T_2[E] \land t[F]=t_2[F]\}$

(d)$\pi_{A,F}(\sigma_{C=D}(r \times s))$

$\{t| \exists t_1 \in r \land \exists t_2 \in s \land t[A]=t_1[A] \land \ t[F]=t_2[F] \land t_1[C]=t_2[D]\}$

Are my queries Correct?

## Related questions

1 vote
1
217 views
$(e.Fname$|$EMPLOYEE(e)\ AND\ ((\forall_{d})[ (DEPENDENT(d)\ AND\ d.ssn= e.ssn \ AND\ (d.sex='M'))\rightarrow (d.age>30))] )$ EMPLOYEE Fname SSn Sex Ram 1 M Shyam 2 M Ravi 3 M Sita 4 F DEPENDENT SSN SEX AGE 1 M 35 1 F 25 1 M 15 2 ... on the basis of above instances of tables, which of the following option is true of output of above query?? $Ram,Shyam,Ravi,Sita$ $Shyam ,Ravi,Sita$ $Shyam$ $Empty$
1 vote