> For the complete documentation index, see [llms.txt](https://web3-analytics.gitbook.io/product-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://web3-analytics.gitbook.io/product-docs/product-guides/creating-queries.md).

# Creating queries

## Step 1 - Add a new query

First, navigate to queries in the top nav and click '+' to add a new query.

<figure><img src="https://2470809873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMC3nnXBNr42atXRANYhr%2Fuploads%2FgCnJuWa3gGrWRR0SpveH%2Fimage.png?alt=media&amp;token=b2937af6-5462-45b8-b5bb-7efdda816b85" alt=""><figcaption></figcaption></figure>

Name your new query anything you like.

<figure><img src="https://2470809873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMC3nnXBNr42atXRANYhr%2Fuploads%2FSwBZB8WnaqKerdQn1TQ8%2Fimage.png?alt=media&amp;token=167606b8-ef38-4567-a50b-5afef01f6f6b" alt=""><figcaption></figcaption></figure>

## Step 2 - Write your SQL

After adding a query, you will be redirected to the query page and able to customize your SQL query. Web3 Analytics uses the [Presto SQL syntax](https://prestodb.io/docs/current/index.html).

<figure><img src="https://2470809873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMC3nnXBNr42atXRANYhr%2Fuploads%2FCNpw3QXPA8TDKopcLear%2Fimage.png?alt=media&amp;token=ca0a2b8c-1bbd-4612-83aa-230c299f10a8" alt=""><figcaption></figcaption></figure>

All data is stored in the 'events' table, and the default query is:

```
SELECT * from events;
```

On queries you have created, a list of available fields and their datatype is shown to the left of the SQL editor.&#x20;

Clicking on a field name will insert a reference to the field where your cursor is in the SQL editor.

## Step 3 - Run your query

If you run your query, you can browse through results 100 records at a time. Your query is saved every time it is successfully run.&#x20;

You can also filter the data or download it as a CSV file.

<figure><img src="https://2470809873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMC3nnXBNr42atXRANYhr%2Fuploads%2FkVIFd1BAEw5IRu7Hswac%2Fimage.png?alt=media&amp;token=f9b802de-09e7-46f3-bc1e-dbd5393421bd" alt=""><figcaption></figcaption></figure>
