The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

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

+20 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.1k
- Engineering Mathematics 4.5k
- Digital Logic 1.9k
- Programming & DS 3.3k
- Algorithms 2.9k
- Theory of Computation 3.6k
- Compiler Design 1.4k
- Databases 2.7k
- CO & Architecture 2.4k
- Computer Networks 2.7k
- Non GATE 901
- Others 1.2k
- Admissions 246
- Exam Queries 433
- Tier 1 Placement Questions 17
- Job Queries 42
- Projects 4

32,330 questions

39,145 answers

108,247 comments

36,501 users