---
title: "Tables and SQL"
description: "See every table your tools sync, spot the ones out of date, and query them by hand."
url: https://www.gatlas.ai/docs/tables
markdown_url: https://www.gatlas.ai/docs/tables.md
---

# Tables and SQL

A table holds one kind of record a tool sent, such as its invoices, kept as it arrived. Check what arrived here before you build a dataset on it.

## Tables page

**Tables**, under Library in the sidebar, lists every table your tools sync, by company and tool. Each row shows the table's row count, when it last synced, its status and the datasets that read it.

A table's plain name sits over its raw name, the one SQL and agents use. Beside each company is its schema, the part of a raw name before the dot, which you type in SQL.

Open a table to read what it holds, and for the rest:

- **Rows by connection**: how many rows each connection sent.
- **Used by**: the datasets that read the table.
- **Columns**: each column's name and type.

Then choose **Open in SQL** to query it. Search finds a table by its name or by a column in it.

If your workspace loads into your own warehouse, Gatlas cannot list its tables here. Browse them in your warehouse instead.

## Out-of-date tables

A table reads **Out of date** when its newest rows are 7 days or more older than its tool's last sync, and no sync has read the table in full since. The tool ran, but not all of this table. A table each sync reads in full is current even when nothing new has arrived for months. Agents read the same rule.

Choose **Out of date** in the status filter to see only those tables. Often the table was taken off the connection, or the tool refused it. Open the connection on **Connections**, under Sources in the sidebar, to see which.

A connection has its own rule: **No sync in 2 days** means the connection has not synced at all for 48 hours. See [Connecting tools](https://www.gatlas.ai/docs/sources.md).

## Query tables in SQL

**SQL**, under Library in the sidebar, is where you check a number at its source. It reads the synced tables of the companies you can see.

1. Find a table on the **Tables** tab, by company and tool and named as on the Tables page, or open one from that page with **Open in SQL**.
2. Write a query and choose **Run**, or press Cmd+Enter.
3. Choose **Export CSV** to take the result away.

**History** holds your recent queries, and **Templates** holds ready-made ones to start from.

When a query is worth keeping, an admin chooses **Save as…** to turn it into a dataset or a draft. Your datasets are listed beside the editor, so you can open one to change its query. What a dataset is, and how to describe it for agents, is in [Datasets](https://www.gatlas.ai/docs/datasets.md).
