# Amazon Athena

> An AWS service that runs SQL on files in S3. You pay for the data each query reads.

**Field:** Data Engineering  
**Category:** Analytics & BI  
**Also known as:** Athena, AWS Athena

## Think of it like

It is like a library where you pay for each page you read. You never pay for the shelves.

## Definition

Amazon Athena is an AWS service that runs SQL on files stored in Amazon S3. There are no servers to set up or keep running. You point it at a folder of files, describe the table, and ask your question. You pay for the data each query reads, not for time. Its SQL engine comes from the open-source Trino and Presto projects.

## Example

Lucy keeps a year of web logs in S3. One Athena query reads 200 GB and costs about $1, at $5 per terabyte read.

## Example code

```sql
SELECT status, COUNT(*) AS hits
FROM web_logs
WHERE day = '2026-03-02'
GROUP BY status;
```

Plain SQL over files. A filter on the day reads less data, so the query costs less.

## Why it matters

Teams can query files in a lake without running a warehouse. For a few questions a week, it costs very little.

## Common mistake

Querying raw CSV files with no partitions. Each query then reads everything, and the bill grows fast.

## Three principles

- **No servers.** AWS runs the engine for you.
- **Pay per scan.** The bill follows the data read.
- **Files stay put.** The data stays in S3 as files.

## Related terms

- [Query Engine](https://learn.benibix.com/term/data/query-engine)
- [Trino](https://learn.benibix.com/term/data/trino)
- [Amazon S3](https://learn.benibix.com/term/data/amazon-s3)
- [External Table](https://learn.benibix.com/term/data/external-table)
- [Data Lake](https://learn.benibix.com/term/data/data-lake)
- [Partition Pruning](https://learn.benibix.com/term/data/partition-pruning)
- [Apache Parquet](https://learn.benibix.com/term/data/apache-parquet)

![One SQL query goes into a query engine made of a coordinator and three workers. Connectors lead from the workers to three places the data lives: a PostgreSQL database, Parquet files in a data lake and a Kafka topic. The answer comes back as one table.](https://learn.benibix.com/diagrams/query-engine.svg)

---

Source: https://learn.benibix.com/term/data/amazon-athena
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
