search
Log In
0 votes
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?
in Databases 124 views

Please log in or register to answer this question.

Related questions

1 vote
1 answer
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$
asked Jul 10, 2018 in Databases Prateek Raghuvanshi 217 views
1 vote
0 answers
2
134 views
How does the evaluation will be done?
asked Jan 11, 2018 in Databases AnilGoudar 134 views
0 votes
0 answers
3
143 views
How to solve SQL problems related to subqueries quickly? Though I have concepts still I face some difficulties in solving this problems
asked Dec 23, 2017 in Databases soumayan bandhu 143 views
0 votes
0 answers
4
292 views
Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId). Note that the DeptId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus. Query 1 {t ... in the result set will be in the domain of the expression given. Am I correct in reasoning for both of the queries.?
asked Dec 27, 2018 in Databases Ayush Upadhyaya 292 views
...