# DBMS Nested-Loop Join Algorithm MCQs

DBMS Nested-Loop Join Algorithm MCQs: This section contains multiple-choice questions and answers on Nested-Loop Join Algorithm in DBMS.
Submitted by Anushree Goswami, on May 15, 2022

1. Nested loop joins are joins in which there are two nested ___ loops.

1. Of
2. For
3. Nor
4. Xor

Explanation:

Nested loop joins are joins in which there are two nested for loops.

2. An algorithm known as the ___ is used to perform the nested loop join, e.g. θ on two relations r and s.

1. Loop Join Algorithm
2. Nested Loop Join Algorithm
3. Join Algorithm
4. None of the above

Answer: B) Nested Loop Join Algorithm

Explanation:

An algorithm known as the Nested loop join algorithm is used to perform the nested loop join, e.g. θ on two relations r and s.

3. Computations are carried out by r ⋈ θ s where r represents the ___ relation and s represents the ___ relation.

1. Outer, Inner
2. Inner, Outer
3. Inner
4. Outer

Explanation:

Computations are carried out by r θ s where r represents the outer relation and s represents the inner relation.

4. Unlike linear file scans, nested-loop joins don't require any ____ to access the data.

1. Setting
2. Indexing
3. Pointing
4. None

Explanation:

Unlike linear file scans, nested-loop joins don't require any indexing to access the data.

5. Nesting-loop joins are very ____ due to the fact that each pair of tuples in the two given relations must be computed and examined separately.

1. Cheap
2. Expensive
3. Few
4. None

Explanation:

Nesting-loop joins are very expensive due to the fact that each pair of tuples in the two given relations must be computed and examined separately.

6. In the event that any of the relationships given is completely compatible with the memory, it is essential to use that relationship as the ___ relation.

1. Inner
2. Outer
3. Both a and b
4. None of the above

Explanation:

In the event that any of the relationships given is completely compatible with the memory, it is essential to use that relationship as the inner relation.

7. A nested-loop join with blocks of the inner relation paired with blocks of the outer relation is known as a ____ nested-loop join.

1. Inner
2. Outer
3. Block
4. Nested

Explanation:

A nested-loop join with blocks of the inner relation paired with blocks of the outer relation is known as a block nested-loop join.

8. In a situation where the buffer size is small enough to store the entire relationship in memory, the ____ nested-loop join saves the need for major ____ accesses.

1. Block
2. Inner
3. Outer
4. None

Explanation:

In a situation where the buffer size is small enough to store the entire relationship in memory, the block nested-loop join saves the need for major block accesses.

9. Every tuple from one block is paired with every tuple from the other block in the ___ to produce all pairs of tuples.

1. Block nested-loop
2. Nested-loop
3. Join-loop
4. None

Explanation:

Every tuple from one block is paired with every tuple from the other block in the block nested-loop to produce all pairs of tuples.

10. Block Nested-Loop ___ algorithm is the algorithm used to perform nested-loop block joins.

1. Join
2. Block
3. Inner
4. Outer

Explanation:

Block Nested-Loop Join algorithm is the algorithm used to perform nested-loop block joins.

11. A block nested-loop join is worst case when blocks in the inner relation s are read ____ for each block in the outer relation r.

1. Once
2. Twice
3. Thrice
4. Multiple times

Explanation:

A block nested-loop join is worst case when blocks in the inner relation s are read once for each block in the outer relation r.

12. For each tuple in the inner relationship s, the ____-loop join reads it once for each tuple in the outer relationship r.

1. Join
2. Nested
3. Block
4. None

Explanation:

For each tuple in the inner relationship s, the nested-loop join reads it once for each tuple in the outer relationship r.

13. It is efficient to use the inner relation s as the outer relation if neither of the given relations r or s completely fit into the ____.

1. Block
2. Size
3. Memory
4. Storage

Explanation:

It is efficient to use the inner relation s as the outer relation if neither of the given relations r or s completely fit into the memory.

14. As soon as the first match is found for each outer relation tuple in a/an _____, the inner loop terminates.

1. Equijoin
2. Natural join
3. Both A and B
4. None of the above

Answer: C) Both A and B

Explanation:

As soon as the first match is found for each outer relation tuple in an equijoin or natural join, the inner loop terminates.

15. Rather than relying on disk blocks for the block nested-loop join algorithm, we can use the ____ size that will fit into memory while allowing enough room for buffers of the inner relations.

1. Smallest
2. Tiny
3. Largest
4. None

Explanation:

Rather than relying on disk blocks for the block nested-loop join algorithm, we can use the largest size that will fit into memory while allowing enough room for buffers of the inner relations.

16. A scanning of the inner loop can be performed alternately in _____ directions.

1. Forward
2. Reverse
3. Both A and B
4. None of the above

Answer: C) Both A and B

Explanation:

A scanning of the inner loop can be performed alternately in forward and reverse directions.

17. Additionally, the order of the request allows for ____ of the data left over from the previous scan.

1. Misuse
2. Use
3. Reuse
4. None

Explanation:

Additionally, the order of the request allows for reuse of the data left over from the previous scan.

18. We can replace the file scans with highly efficient index lookups if an index is present on the ___ attribute of the inner loop.

1. Log
2. Join
3. Array
4. Stack

Explanation:

We can replace the file scans with highly efficient index lookups if an index is present on the join attribute of the inner loop.

19. A nested-loop indexed join can be performed using ____ created during the evaluation of the join.

1. Existing indexes
2. Temporary indexes
3. Both A and B
4. None of the above

Answer: C) Both A and B

Explanation:

A nested-loop indexed join can be performed using either existing indexes or temporary indexes created during the evaluation of the join.

20. Nested-loop joins optimized with indexed nested loops are ____ than traditional loop joins.

1. Slower
2. Faster
3. Comparatively Slower
4. None

Explanation:

Nested-loop joins optimized with indexed nested loops are faster than traditional loop joins.

Preparation

What's New

Top Interview Coding Problems/Challenges!