---
# System prepended metadata

title: Ethereum Query Early Access

---

# Ethereum Query Early Access

Welcome to the early access for querying Ethereum blockchain data. This early access is intended to be used as a way to iterate and is not representative of the final product.

*Note: In this preview, only a subset of the blockchain is available for querying.*

## Connection Instructions

1. Open up your SQL editor and add a new connection. Search for a `Dremio` database driver. If a Dremio driver is not available then download the appropriate driver depending on if your SQL editor is Java-based or not.
    - [JDBC Dremio Driver](https://www.dremio.com/drivers/jdbc/) - Java-based driver
    - [ODBC Dremio Driver](https://www.dremio.com/drivers/odbc/)
1. In the connection settings, use the following table to fill out the correct values.

| Host          | Port  | User      | SSL   | Connection Type | JDBC URL                               |
| ------------- | ----- | --------- | ----- | --------------- |:-------------------------------------- |
| 52.137.98.237 | 31010 | spiceprod | False | Direct          | jdbc:dremio:direct=52.137.98.237:31010 |

Ask Luke or Phillip for the password

3. Click the "Test Connection" button to verify the settings are correct.

## Usage

In your SQL editor, create a console query. Connect to the `eth` schema:

```sql=
use eth;
```

To view the tables available, use the `show tables` command.

```sql=
show tables;
```

In the early access, there are 6 tables available:



| Table Name      | Description                                   |
| --------------- | --------------------------------------------- |
| blocks          | Block headers                                 |
| receipts        | The transaction receipts for each transaction |
| logs            | The event logs for transactions               |
| token_transfers | Records of token transfers                    |
| tokens          | A listing of all known token contracts        |

The columns available for each table can be viewed with the `describe <table>;` command:

```sql=
/* Show the columns available */
describe blocks;
describe receipts;
describe logs;
describe token_transfers;
describe tokens;
```

## Sample Queries

Get 10 blocks with their block number and gas_used

```sql=
select number, gas_used from blocks limit 10;
```

Get the minimum block number and the maximum block number available in the dataset.

```sql=
select min(number) as min_block, max(number) as max_block from blocks;
```

For the most recent 10 blocks get the average gas used for transactions in that block

```sql=
select block_number, avg(cumulative_gas_used) as avg_gas_used from receipts group by block_number order by block_number desc limit 10;
```

See all transfers of USDT (Tether) starting with the most recent.

```sql=
select block_number, "value", token_address from token_transfers where token_address = '0xdac17f958d2ee523a2206206994597c13d831ec7' order by block_number desc;
```