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

# SQL Notebook

> Run SQL queries on your datasets

You can run SQL queries on your datasets to explore and analyze your data.

<div style={{ position: "relative", paddingBottom: "56.25%", height: 0 }}>
  <iframe
    src="https://www.loom.com/embed/654bbc7bff414bdea0f116a62a2baa66"
    frameborder="0"
    webkitallowfullscreen
    mozallowfullscreen
    allowfullscreen
    style={{
  position: "absolute",
  top: 0,
  left: 0,
  width: "100%",
  height: "100%",
}}
  />
</div>

### How does it work?

When you open the SQL Notebook, a local SQLite database is created in your browser's local storage. All your queries are run against this database.

You can run most SQL queries supported by **SQLite**.

<Tip>
  Queries will be saved for each dataset so your team can share queries and
  results.
</Tip>

<Warning>
  Note: Since the dataset is stored in your browser's local storage, it may
  consume a lot of memory for large datasets.
</Warning>

### Available Tables & Columns

The sidebar on the left will indicate which tables and columns are accessible.

<Tip>
  Pro tip: You can also run SQL queries when [comparing
  datasets](/datasets/compare-datasets).
</Tip>

### Example Queries

```sql
-- Select all
select * from dataset;
```

```sql
-- Select all with filters
select * from dataset where "Response Faithfulness" > 0.9;
```

```sql
-- Get average eval score grouped by topic
select topic, avg("Factual Accuracy")
from dataset
group by topic;
```

<Warning>
  Note: Any changes you make to the database are not persisted to the dataset
  when you close the browser tab.
</Warning>

### Related

* **[Get dataset programmatically](/api-reference/datasets/get-dataset)**
* **[Export dataset](/datasets/export-datasets)**
* **[Compare datasets](/datasets/compare-datasets)**
