The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+27 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

- $\sigma_{A=a}(r)$
- $r$
- $\sigma_{A=a}(r) \bowtie s$
- None of the above

+22 votes

Best answer

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.

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.

- All categories
- General Aptitude 1.2k
- Engineering Mathematics 4.8k
- Digital Logic 2k
- Programming & DS 3.5k
- Algorithms 3k
- Theory of Computation 3.8k
- Compiler Design 1.5k
- Databases 2.8k
- CO & Architecture 2.5k
- Computer Networks 2.9k
- Non GATE 940
- Others 1.2k
- Admissions 320
- Exam Queries 409
- Tier 1 Placement Questions 17
- Job Queries 52
- Projects 8

34,170 questions

40,846 answers

115,882 comments

39,703 users