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

# Run a basic query

> Write and run SQL against Allium's data in the Allium App.

Query any Allium table with SQL, from raw chain data to cross-chain models such as `crosschain.dex.trades` and `stablecoins.core.supply_daily`.

**1. Create a query**

Open **Library > Queries**, choose **New**, and name the query.

**2. Write your SQL**

The schema browser lists every schema and table, with each table's docs. This query reads the daily circulating supply of five stablecoins:

```sql theme={null}
-- Daily circulating supply of the largest stablecoins over the last 90 days
select
  date,
  token_symbol,
  sum(circulating_supply_usd) as circulating_supply_usd
from stablecoins.core.supply_daily
where
  date >= current_date - 90
  and token_symbol in ('USDT', 'USDC', 'USDe', 'USDS', 'PYUSD')
group by all
order by date
```

**3. Run it**

Choose **Run**, or press `Cmd` + `Enter`. Run saves the query first, then returns the results as a table.

![Query editor with the stablecoin supply SQL and a results table of date, token symbol and circulating supply](https://mintcdn.com/allium-e770e2b7/2Cik69FC65-mGWej/images/app/queries/editor.webp?fit=max\&auto=format\&n=2Cik69FC65-mGWej\&q=85\&s=f8fdd4301abafab6e0edff4bb439914b)

* Edits are saved only by **Save** or a run, so save before leaving a query you haven't run.
* A query runs on the compute profile you pick for it. See [Compute profiles](https://docs.allium.so/app/query-management/compute-profiles.md).
* **File > Export CSV** downloads the results, where your plan includes exports.

## Next steps

> [card] [Visualize results](https://docs.allium.so/app/visualisations.md)
>
> Chart the results and share them.

> [card] [Parameterized queries](https://docs.allium.so/app/run-queries/parameterized-query.md)
>
> Rerun the same SQL with different values.

> [card] [Query a previous result](https://docs.allium.so/app/run-queries/query-on-previous-result.md)
>
> Build on a finished run without recomputing it.

> [card] [Explorer API](https://docs.allium.so/api/explorer/overview.md)
>
> Run saved queries through the API.
