# Table Subquery

*noun*

say it: **“TAY-bul SUB-kweer-ee”** **/ˈteɪbəl ˈsʌbkwɪəri/**

A subquery that returns rows and columns, used in FROM as if it were a table.

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

**Table Subquery** — A subquery producing rows and columns that another query can use as a table.

```sql
SELECT recent.order_id
FROM (
    SELECT order_id
    FROM purchase_order
    WHERE ordered_on >= DATE '2026-01-01'
) AS recent;
```

## In a sentence

- “A **table subquery** worked out order totals, and the outer query averaged them.”

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

Updated: November 9, 2026

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