for (i = 0; i < N; i++) // Outer loop
{
for (j = 5; j < N; j++) // Inner loop
{
...
}
}
|
The inner loop is independent from the outer loop
In fact:
|
for (i = 0; i < N; i++) // Outer loop
{
for (j = i; j < N-i; j++) // Inner loop
{
...
}
}
|
The inner loop is dependent on the outer loop through the variable i.
|
The inner query is independent from the outer query.
|
 
|
The attribute attr4 of the relation R1 in the outer query is used in the inner query
SELECT fname, lname, salary, dno from employee A where salary >= ALL (select salary from employee B where B.dno=A.dno) |
FOR (each tuple a ∈ A (= employee) in the outer query) DO
{
Evaluate the tuple condition using the attribute values
found in the tuple a in the outer query;
}
|
SELECT fname, lname, salary, dno from employee A where salary >= ALL (select salary from employee B where B.dno=A.dno) |
|
|