The join mentioned in the query is theta join ( join does the cross product whenever the condition is matched).
Query: $(AUB)\Join _{A.Id>15 VC.Id<15}C$. First we find AUB.
AUB
Id |
Name |
Age |
12 |
Arun |
60 |
15 |
Shreya |
24 |
25 |
Hari |
40 |
98 |
Rohit |
20 |
99 |
Rohit |
11 |
C
Id |
Phone |
Area |
10 |
2200 |
02 |
99 |
2100 |
01 |
Now, if any one of the join condition matches, we do the cross product of tuples where condition becomes TRUE.
For first four tuples of (AUB), A.ID>15 remains FALSE, but C.ID<15 becomes TRUE.
So, First tuple of C appears cross product with first four tuples of (AUB).
And for last two tuples of (AUB) A.ID>15 becomes TRUE, but C.ID<15 remains FALSE.
So, last two tuples of (AUB) are cross product with each of the two tuples of C.
We get the final result as:
Query Result
Id |
Name |
Age |
Id |
Phone |
Area |
12 |
Arun |
60 |
10 |
2200 |
02 |
15 |
Shreya |
24 |
10 |
2200 |
02 |
25 |
Hari |
40 |
10 |
2200 |
02 |
98 |
Rohit |
20 |
10 |
2200 |
02 |
98 |
Rohit |
20 |
99 |
2100 |
01 |
99 |
Rohit |
11 |
10 |
2200 |
02 |
99 |
Rohit |
11 |
99 |
2100 |
01 |
So, total 7 tuples are in result.
Ans: (A).