# Table Subquery

A subquery producing rows and columns that another query can use as 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;
```

Level: Apprentice · [More Database terms at this level](https://www.ask-codey.com/glossary/subjects/database/apprentice)

Updated: September 27, 2026

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