Consider the relations r(A, B) and s(B, C), where s.B is a primary key and r.B is a foreign key referencing s.B. Consider the query
Let LOJ denote the natural left outer-join operation. Assume that r and s contain no null values.
Which one of the following is NOT equivalent to Q?
(A) σB<5(r ⋈ s)
(B) σB<5(r LOJ s)
(C) r LOJ (σB<5(s))
(D) σB<5(r)LOJ s
Answer: (C)
Explanation: Since, we are joining/LOJ using attribute B which is primary key of table s and foreign key of table r.
So, we need to apply condition σB<5 on left table of join always, i.e., table r because left outer join (LOJ) returns all the values from an inner join plus all values in the left table that do not match to the right table.
So, option (C) is correct.
Quiz of this Question
Recommended Posts:
- GATE | GATE CS Mock 2018 | Question 39
- GATE | GATE CS 2018 | Question 5
- GATE | GATE CS 2018 | Question 6
- GATE | GATE CS 2018 | Question 4
- GATE | GATE CS Mock 2018 | Set 2 | Question 23
- GATE | GATE CS Mock 2018 | Set 2 | Question 24
- GATE | GATE CS Mock 2018 | Set 2 | Question 25
- GATE | GATE CS Mock 2018 | Set 2 | Question 26
- GATE | GATE CS Mock 2018 | Set 2 | Question 27
- GATE | GATE CS Mock 2018 | Set 2 | Question 28
- GATE | GATE CS Mock 2018 | Set 2 | Question 29
- GATE | GATE CS Mock 2018 | Set 2 | Question 30
- GATE | GATE CS Mock 2018 | Set 2 | Question 31
- GATE | GATE CS Mock 2018 | Set 2 | Question 32
- GATE | GATE CS Mock 2018 | Set 2 | Question 33
- GATE | GATE CS Mock 2018 | Set 2 | Question 34
- GATE | GATE CS Mock 2018 | Set 2 | Question 35
- GATE | GATE CS Mock 2018 | Set 2 | Question 36
- GATE | GATE CS Mock 2018 | Set 2 | Question 37
- GATE | GATE CS Mock 2018 | Set 2 | Question 38

