This is a follow-up blog post to my earlier blog post written about SQL SERVER – Writing Your First Subquery From a Single Table. In the blog post, we discuss how to write a correlated subquery and why it is actually necessary. In a query, a correlated subquery is a subquery that uses values from the outer query. Subqueries are usually running once for each row processed for outer query and that is why they are often inefficient as well.