Advanced
SQL
Q93 / 100
What is a "lateral join" (or CROSS APPLY in SQL Server) used for?
Correct! Well done.
Incorrect.
The correct answer is B) It allows a subquery on the right side of the join to reference columns from the left side's current row, enabling per-row correlated computations such as "top N per group"
B
Correct Answer
It allows a subquery on the right side of the join to reference columns from the left side's current row, enabling per-row correlated computations such as "top N per group"
Explanation
Unlike a normal join where both sides are evaluated independently, a LATERAL (or CROSS/OUTER APPLY) join lets the right-hand subquery reference columns from the left-hand row, enabling row-by-row correlated subqueries like fetching the top N related records per row.
Progress
93/100