> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exmergo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Explore a warehouse

> Find the tables that matter, inspect their grain and data quality, and verify joins before writing SQL. Turn a warehouse map into a focused investigation.

**Outcome:** a map of the relevant tables, evidence for their grain, and measured
join behavior. Start from a [connected project](https://docs.exmergo.com/dex/connect.md), or use the
[demo warehouse](https://docs.exmergo.com/dex/quickstart.md).

## Start with a question

Give your agent a purpose for the exploration:

```text theme={null}
Use Dex to investigate how orders relate to customers. Profile the tables
we need, verify their joins, and report duplicate keys or missing parents.
```

On a large warehouse, scope the request to a business area before widening it.

## Map, then inspect

```bash theme={null}
dex explore inventory --rank
dex explore map
```

Inventory identifies the important objects; the map adds profiles and inferred
relationships. Read the map's skipped objects and elision counts before treating
it as a complete inventory of the warehouse.

Then profile the relations your question actually reads. On the demo:

```bash theme={null}
dex explore profile orders customers
dex explore relationships --verify
```

Check whether a proposed key is unique, whether it contains NULLs, and whether
the join has unmatched rows or multiplies the parent. A declared relationship
states the project's intent; verification measures the data behind that claim.

## Ask the data question

```bash theme={null}
dex explore query "select status, count(*) as order_count from orders group by status"
```

Use `explore query` for SQL questions so profiling, scope, cost, and PII checks
apply. Read the reported truncation and warnings along with the answer.

## Keep the evidence useful

A useful exploration report names the grain, joins that were verified, findings
that affect the question, and anything left unmeasured. It distinguishes what
the project declares from what the data proves.

> [accordion] Include the existing project and semantic layer
>
> ```bash theme={null}
> dex explore map --use-project
> dex explore relationships --verify --use-project
> ```
>
> These commands include local project declarations and semantic relationships.
> A declaration can inform a map without proving its assertion against the data.

> [accordion] Show the map as a diagram
>
> ```bash theme={null}
> dex explore diagram
> ```
>
> The result contains Mermaid text under `data.mermaid`. Your agent can render it.
> The diagram reads the cached map and does not query the warehouse. Use `--full`
> when you need more of the cached objects and columns.

## Continue

Use the evidence to [transform a model](https://docs.exmergo.com/dex/guides/transform.md). For selection
rules and measurement detail, read the [exploration methodology](https://docs.exmergo.com/dex/concepts/methodology.md).
For every option, use [`dex explore`](https://docs.exmergo.com/dex/cli/explore).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.