# Correlated Subquery

*noun*

say it: **“KOR-uh-lay-tid SUB-kweer-ee”** **/ˈkɔːrəleɪtɪd ˈsʌbkwɪəri/**

A subquery that uses a value from the outer query, so it runs once for each outer row.

## What is **Correlated Subquery** in a relational database?

**Correlated Subquery** — A subquery that refers to values from an outer query and is evaluated in that context.

```sql
SELECT customer_id
FROM customer
WHERE EXISTS (
    SELECT 1
    FROM purchase_order
    WHERE purchase_order.customer_id = customer.customer_id
);
```

## In a sentence

- “A **correlated subquery** finds each product priced above its own category's average.”

Level: Journeyman · [More SQL terms at this level](https://www.ask-codey.com/glossary?category=sql&level=3)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/correlated-subquery
