The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+29 votes

Let r and s be two relations over the relation schemes R and S respectively, and let A be an attribute in R.  The relational algebra expression $\sigma_{A=a}(r \bowtie s)$ is always equal to

  1. $\sigma_{A=a}(r)$
  2. $r$
  3. $\sigma_{A=a}(r) \bowtie s$
  4. None of the above
asked in Databases by Veteran (52k points)
retagged by | 1.7k views
here selection is based on constant value ,so its better to filter r first

,if selection is based on compaison of attributes it is better to first cartesian then apply condition
why this question tagged as difficult?
A and B will be false when S is empty.

4 Answers

+24 votes
Best answer

Answer is C.

C is just the better form of query, more execution friendly because requires less memory while joining. query, given in question takes more time and memory while joining.

answered by Loyal (8.1k points)
edited by
thanks to early use of selection
If we consider answer C means, tables will be joined using column 'A'.There may be other similar columns in two tables.Suppose column 'B' is in both.

PLZ explain.
According to the equation in the question, we take a join of r and s and then select the rows where attribute A has the value a. In option C, we first apply the filter, i.e. select those rows from r where A attribute has value a and then apply join with s. Hence, C is optimised as the number of rows used in the join is less.
@sumaiya mam very nice
+7 votes
Answer is (C).

It is an efficient way to write the query to select first the tuples then cross with other relation.
answered by (153 points)
+5 votes

 option c

answered by Boss (33.9k points)
what is "relation schemes R and S respectively" in this question??
why you have taken B attribute in relation r and how come B & C attribute
What if B dont have entry

+4 votes
Answer is (C).

It is an efficient way to write the query.First apply selection condition to reduce the number of tuples then apply cross product.
answered by (153 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,541 questions
54,084 answers
70,994 users