304 views

1 Answer

1 votes
1 votes
This is a correlation query .

It works as a nested for loop.

The above query can be visualised as---

For every entry in R1

{

check if (∃ tuple in R such that R1.A=R.B)

{ do not select the tuple

}

else

{print the tuple in output

}

}

In above statements R1.A is outer loop variable and R.B is inner loop variable.

Now while executing--->

For R1.A=1 ∃ R.B such that R1.A = R.B        =>    not selected

For R1.A =2 ∃ R.B such that R1.A= R.B       =>    not selected

For R1.A = 3 ∄ R.B such that R1.A = R.B      => selected

For R1.A = 4 ∄ R.B such that R1.A = R.B     => selected

..thus 2 tuples would be in output

Related questions

0 votes
0 votes
0 answers
1
SandeepKumar147 asked 1 day ago
23 views
0 votes
0 votes
0 answers
2
0 votes
0 votes
0 answers
4
amitarp818 asked Dec 5, 2023
217 views